Skip to content

Commit 5b7711e

Browse files
committed
Merge branch '1.9.x' into 1.11.x
2 parents f9cef77 + e68ea21 commit 5b7711e

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

implementations/micrometer-registry-atlas/src/main/java/io/micrometer/atlas/AtlasMeterRegistry.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,16 @@ protected io.micrometer.core.instrument.DistributionSummary newDistributionSumma
107107
com.netflix.spectator.api.DistributionSummary internalSummary;
108108

109109
if (distributionStatisticConfig.isPercentileHistogram()) {
110+
long min = distributionStatisticConfig.getMinimumExpectedValueAsDouble() == null ? 0
111+
: distributionStatisticConfig.getMinimumExpectedValueAsDouble().longValue();
112+
long max = distributionStatisticConfig.getMaximumExpectedValueAsDouble() == null ? Long.MAX_VALUE
113+
: distributionStatisticConfig.getMaximumExpectedValueAsDouble().longValue();
110114
// This doesn't report the normal count/totalTime/max stats, so we treat it as
111115
// additive
112-
internalSummary = PercentileDistributionSummary.get(registry, spectatorId(id));
116+
internalSummary = PercentileDistributionSummary.builder(registry)
117+
.withId(spectatorId(id))
118+
.withRange(min, max)
119+
.build();
113120
}
114121
else {
115122
internalSummary = registry.distributionSummary(spectatorId(id));
@@ -134,9 +141,16 @@ protected Timer newTimer(Meter.Id id, DistributionStatisticConfig distributionSt
134141
com.netflix.spectator.api.Timer internalTimer;
135142

136143
if (distributionStatisticConfig.isPercentileHistogram()) {
144+
long minNanos = distributionStatisticConfig.getMinimumExpectedValueAsDouble() == null ? 0
145+
: distributionStatisticConfig.getMinimumExpectedValueAsDouble().longValue();
146+
long maxNanos = distributionStatisticConfig.getMaximumExpectedValueAsDouble() == null ? Long.MAX_VALUE
147+
: distributionStatisticConfig.getMaximumExpectedValueAsDouble().longValue();
137148
// This doesn't report the normal count/totalTime/max stats, so we treat it as
138149
// additive
139-
internalTimer = PercentileTimer.get(registry, spectatorId(id));
150+
internalTimer = PercentileTimer.builder(registry)
151+
.withId(spectatorId(id))
152+
.withRange(minNanos, maxNanos, TimeUnit.NANOSECONDS)
153+
.build();
140154
}
141155
else {
142156
internalTimer = registry.timer(spectatorId(id));

0 commit comments

Comments
 (0)