Skip to content

Commit

Permalink
all digest meters forward to percentile variant
Browse files Browse the repository at this point in the history
This is a first step if phasing applications from digest to
histogram based percentile approximation. Both will be published
and we can then drop the digest variants after enough data is
available and dashboards have been updated.
  • Loading branch information
brharrington committed Jan 14, 2016
1 parent ba78115 commit b55c984
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

import com.netflix.spectator.api.*;
import com.netflix.spectator.api.Counter;
import com.netflix.spectator.api.histogram.PercentileDistributionSummary;
import com.netflix.spectator.api.histogram.PercentileTimer;

import javax.inject.Inject;
import java.util.concurrent.TimeUnit;
Expand All @@ -41,11 +43,13 @@ public TDigestRegistry(Registry registry, TDigestConfig config) {
}

@Override protected TDigestDistributionSummary newDistributionSummary(Id id) {
return new TDigestDistributionSummary(newDigest(id), underlying.distributionSummary(id));
DistributionSummary summary = PercentileDistributionSummary.get(underlying, id);
return new TDigestDistributionSummary(newDigest(id), summary);
}

@Override protected TDigestTimer newTimer(Id id) {
return new TDigestTimer(newDigest(id), underlying.timer(id));
Timer timer = PercentileTimer.get(underlying, id);
return new TDigestTimer(newDigest(id), timer);
}

private StepDigest newDigest(Id id) {
Expand Down

0 comments on commit b55c984

Please sign in to comment.