@@ -107,9 +107,16 @@ protected io.micrometer.core.instrument.DistributionSummary newDistributionSumma
107
107
com .netflix .spectator .api .DistributionSummary internalSummary ;
108
108
109
109
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 ();
110
114
// This doesn't report the normal count/totalTime/max stats, so we treat it as
111
115
// additive
112
- internalSummary = PercentileDistributionSummary .get (registry , spectatorId (id ));
116
+ internalSummary = PercentileDistributionSummary .builder (registry )
117
+ .withId (spectatorId (id ))
118
+ .withRange (min , max )
119
+ .build ();
113
120
}
114
121
else {
115
122
internalSummary = registry .distributionSummary (spectatorId (id ));
@@ -134,9 +141,16 @@ protected Timer newTimer(Meter.Id id, DistributionStatisticConfig distributionSt
134
141
com .netflix .spectator .api .Timer internalTimer ;
135
142
136
143
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 ();
137
148
// This doesn't report the normal count/totalTime/max stats, so we treat it as
138
149
// 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 ();
140
154
}
141
155
else {
142
156
internalTimer = registry .timer (spectatorId (id ));
0 commit comments