Code Monkey home page Code Monkey logo

tally's Introduction

โœ”๏ธ tally Build Status Coverage Status Maven Central

Fast, buffered, hierarchical stats collection in Java. Go here for the Go client.

Abstract

Tally provides a common interface for emitting metrics, while letting you not worry about the velocity of metrics emission.

By default it buffers counters, gauges and histograms at a specified interval but does not buffer timer values. This is primarily so timer values can have all their values sampled if desired and if not they can be sampled as summaries or histograms independently by a reporter.

Structure

  • Scope: Keeps track of metrics, and their common metadata.
  • Metrics: Counters, Gauges, Timers and Histograms.
  • Reporter: Implemented by you. Accepts aggregated values from the scope. Forwards the aggregated values to your metrics ingestion pipeline.

Acquire a Scope

// Implement as you will
StatsReporter reporter = new MyStatsReporter();

Map<String, String> tags = new HashMap<>(2, 1);
tags.put("dc", "east-1");
tags.put("type", "master");

Scope scope = new RootScopeBuilder()
    .reporter(reporter)
    .tags(tags)
    .reportEvery(Duration.ofSeconds(1))

Get/Create a metric; use it

Counter reqCounter = scope.counter("requests");
reqCounter.inc(1);

Gauge queueGauge = scope.gauge("queue_length");
queueGauge.update(42);

Report your metrics

Use one of the inbuilt reporters or implement your own using the StatsReporter interface.

Example Usage

Run the example by running:

$ ./gradlew run

This runs the PrintStatsReporterExample class in the tally-example project.

Artifacts Published

All artifacts are published under the group com.uber.m3.

  1. tally-m3: The tally M3 reporter
  2. tally-statsd: The tally StatsD reporter
  3. tally-core: tally core functionality that includes interfaces and utilities to report metrics to M3
  4. tally-example: Example usages with different reporters
  5. tally-prometheus: The tally Prometheus reporter (experimental; see prometheus/README.md)

Versioning

We follow semantic versioning outlined here. In summary, given a version of MAJOR.MINOR.PATCH (e.g. 1.2.0):

  • MAJOR version changes are breaking changes to the public API
  • MINOR version changes are backwards-compatible changes that include new functionality
  • PATCH version changes are backwards-compatible bug fixes

Released under the MIT License.

tally's People

Contributors

alexeykudinkin avatar andrewmains12 avatar jigarjoshi avatar justinjc avatar meiliang86 avatar mennopruijssers avatar prateek avatar sairamch04 avatar sokolandrey avatar tomliu4uber avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.