You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tally provides a common interface for emitting metrics, while letting you not worry about the velocity of metrics emission.
7
+
Tally provides a common interface for emitting metrics, while letting you not worry about the velocity of metrics
8
+
emission.
8
9
9
-
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.
10
+
By default, it buffers counters, gauges and histograms at a specified interval but does not buffer timer values. This is
11
+
primarily so timer values can have all their values sampled if desired and if not they can be sampled as summaries or
12
+
histograms independently by a reporter.
10
13
11
14
## Structure
12
15
13
16
-**Scope**: Keeps track of metrics, and their common metadata.
14
17
-**Metrics**: Counters, Gauges, Timers and Histograms.
15
18
-**Reporter**: Implemented by you. Accepts aggregated values from the scope. Forwards the aggregated values to your metrics ingestion pipeline.
16
19
17
-
### Acquire a Scope
20
+
### Create a `Scope`
18
21
19
22
```java
20
23
// Implement as you will
21
24
StatsReporter reporter =newMyStatsReporter();
22
25
23
26
Map<String, String> tags =newHashMap<>(2, 1);
24
27
tags.put("dc", "east-1");
25
-
tags.put("type","master");
28
+
tags.put("type","leader");
26
29
27
30
Scope scope =newRootScopeBuilder()
28
31
.reporter(reporter)
29
32
.tags(tags)
30
-
.reportEvery(Duration.ofSeconds(1))
33
+
.reportEvery(Duration.ofSeconds(1));
31
34
```
32
35
33
36
### Get/Create a metric; use it
@@ -43,27 +46,29 @@ queueGauge.update(42);
43
46
44
47
Use one of the inbuilt reporters or implement your own using the `StatsReporter` interface.
45
48
46
-
## Example Usage
49
+
## Usage examples
47
50
48
51
Run the example by running:
49
52
```bash
50
53
$ ./gradlew run
51
54
```
55
+
52
56
This runs the `PrintStatsReporterExample` class in the `tally-example` project.
53
57
54
-
## Artifacts Published
58
+
## Artifacts publishing
55
59
56
60
All artifacts are published under the group `com.uber.m3`.
57
61
58
-
1.`tally-m3`: The tally M3 reporter
59
-
1.`tally-statsd`: The tally StatsD reporter
60
-
1.`tally-core`: tally core functionality that includes interfaces and utilities to report metrics to M3
61
-
1.`tally-example`: Example usages with different reporters
62
-
1.`tally-prometheus`: The tally Prometheus reporter (experimental; see prometheus/README.md)
62
+
1.`tally-m3`: The tally M3 reporter.
63
+
1.`tally-statsd`: The tally StatsD reporter.
64
+
1.`tally-core`: The tally core functionality that includes interfaces and utilities to report metrics to M3.
65
+
1.`tally-example`: Usage examples with different reporters.
66
+
1.`tally-prometheus`: The tally Prometheus reporter (experimental; see prometheus/README.md).
63
67
64
68
## Versioning
65
-
We follow semantic versioning outlined [here](http://semver.org/spec/v2.0.0.html). In summary,
66
-
given a version of MAJOR.MINOR.PATCH (e.g. 1.2.0):
69
+
70
+
We follow semantic versioning outlined [here](http://semver.org/spec/v2.0.0.html). In summary, given a version of
71
+
MAJOR.MINOR.PATCH (e.g. 1.2.0):
67
72
68
73
- MAJOR version changes are breaking changes to the public API
69
74
- MINOR version changes are backwards-compatible changes that include new functionality
0 commit comments