Skip to content

Commit e2b8677

Browse files
committed
Address feedback
Signed-off-by: Bogdan Drutu <[email protected]>
1 parent 79f08f7 commit e2b8677

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

implementations/micrometer-registry-signalfx/src/main/java/io/micrometer/signalfx/SignalFxConfig.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@ default String accessToken() {
4343
}
4444

4545
/**
46-
* Returns {@code true} if the signalfx registry should emit histogram buckets.
46+
* Returns {@code true} if the signalfx registry should emit histogram buckets as
47+
* CumulativeCounter instead of Gauge (as it is by default).
4748
*
48-
* @return {@code true} if the signalfx registry should emit histogram buckets.
49+
* @return {@code true} if the signalfx registry should emit histogram buckets as
50+
* CumulativeCounter instead of Gauge (as it is by default).
4951
*/
5052
default Boolean fixHistogramBucketsType() {
51-
return getBoolean(this, "reportHistogramBuckets").orElse(false);
53+
return getBoolean(this, "fixHistogramBucketsType").orElse(false);
5254
}
5355

5456
/**

implementations/micrometer-registry-signalfx/src/main/java/io/micrometer/signalfx/SignalFxMeterRegistry.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,14 @@ protected TimeUnit getBaseTimeUnit() {
246246

247247
private DistributionStatisticConfig updateConfig(
248248
DistributionStatisticConfig distributionStatisticConfig) {
249-
// Add the +Inf bucket since the "count" resets every export.
250-
double[] sla = distributionStatisticConfig.getServiceLevelObjectiveBoundaries();
251-
if (sla == null || sla.length == 0) {
249+
double[] sloBoundaries = distributionStatisticConfig.getServiceLevelObjectiveBoundaries();
250+
if (sloBoundaries == null || sloBoundaries.length == 0) {
252251
return distributionStatisticConfig;
253252
}
254-
double[] newSLA = sla;
255-
if (!isPositiveInf(sla[sla.length - 1])) {
256-
newSLA = Arrays.copyOf(sla, sla.length + 1);
253+
double[] newSLA = sloBoundaries;
254+
// Add the +Inf bucket since the "count" resets every export.
255+
if (!isPositiveInf(sloBoundaries[sloBoundaries.length - 1])) {
256+
newSLA = Arrays.copyOf(sloBoundaries, sloBoundaries.length + 1);
257257
newSLA[newSLA.length - 1] = Double.MAX_VALUE;
258258
}
259259
return DistributionStatisticConfig.builder()

0 commit comments

Comments
 (0)