Skip to content

Commit

Permalink
indicate type as prefix on idx value
Browse files Browse the repository at this point in the history
Timers are mapped to nanoseconds before computing the
bucket. This allows better precision without needing
to support floating point. For display it is often
preferred to use base units, like seconds. In any
case, it is useful to distinguish whether the value
was reported for a timer or a distribution summary. The
index value stored for the `percentile` key is now
prefixed with a `T` for timers and `D` for distribution
summaries.
  • Loading branch information
brharrington committed Jan 18, 2016
1 parent 81e1814 commit 2b3ea88
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static PercentileDistributionSummary get(Registry registry, Id id) {
this.summary = registry.distributionSummary(id);
this.counters = new Counter[PercentileBuckets.length()];
for (int i = 0; i < counters.length; ++i) {
Id counterId = id.withTag("percentile", String.format("%04X", i));
Id counterId = id.withTag("percentile", String.format("D%04X", i));
counters[i] = registry.counter(counterId);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static PercentileTimer get(Registry registry, Id id) {
this.timer = registry.timer(id);
this.counters = new Counter[PercentileBuckets.length()];
for (int i = 0; i < counters.length; ++i) {
Id counterId = id.withTag("percentile", String.format("%04X", i));
Id counterId = id.withTag("percentile", String.format("T%04X", i));
counters[i] = registry.counter(counterId);
}
}
Expand Down

0 comments on commit 2b3ea88

Please sign in to comment.