diff --git a/implementations/micrometer-registry-prometheus/src/main/java/io/micrometer/prometheus/PrometheusTimer.java b/implementations/micrometer-registry-prometheus/src/main/java/io/micrometer/prometheus/PrometheusTimer.java index acb9bfe82e..fe2bcf4b74 100644 --- a/implementations/micrometer-registry-prometheus/src/main/java/io/micrometer/prometheus/PrometheusTimer.java +++ b/implementations/micrometer-registry-prometheus/src/main/java/io/micrometer/prometheus/PrometheusTimer.java @@ -94,7 +94,7 @@ protected void recordNonNegative(long amount, TimeUnit unit) { max.record(nanoAmount, TimeUnit.NANOSECONDS); if (histogram != null) { - histogram.recordLong(TimeUnit.NANOSECONDS.convert(amount, unit)); + histogram.recordLong(nanoAmount); } } diff --git a/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/logging/LogbackMetrics.java b/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/logging/LogbackMetrics.java index 469e4e07d8..1b6eab8aa1 100644 --- a/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/logging/LogbackMetrics.java +++ b/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/logging/LogbackMetrics.java @@ -206,7 +206,7 @@ public FilterReply decide(Marker marker, Logger logger, Level level, String form // and can return immediately and // avoid the relatively expensive ThreadLocal access below. See also logbacks // Logger.callTurboFilters(). - // Calling logger.isEnabledFor(level) might be sub-optimal since it cals this + // Calling logger.isEnabledFor(level) might be sub-optimal since it calls this // filter again. This behavior caused a StackOverflowError in the past. if (format == null || !level.isGreaterOrEqual(logger.getEffectiveLevel())) { return FilterReply.NEUTRAL; diff --git a/micrometer-core/src/main/java/io/micrometer/core/instrument/distribution/TimeWindowFixedBoundaryHistogram.java b/micrometer-core/src/main/java/io/micrometer/core/instrument/distribution/TimeWindowFixedBoundaryHistogram.java index 5b26644f7d..5f3a2aa901 100644 --- a/micrometer-core/src/main/java/io/micrometer/core/instrument/distribution/TimeWindowFixedBoundaryHistogram.java +++ b/micrometer-core/src/main/java/io/micrometer/core/instrument/distribution/TimeWindowFixedBoundaryHistogram.java @@ -118,9 +118,10 @@ void outputSummary(PrintStream printStream, double bucketScaling) { String bucketFormatString = "%14.1f %10d\n"; + FixedBoundaryHistogram currentHistogram = currentHistogram(); for (int i = 0; i < buckets.length; i++) { printStream.format(Locale.US, bucketFormatString, buckets[i] / bucketScaling, - currentHistogram().values.get(i)); + currentHistogram.values.get(i)); } printStream.write('\n'); diff --git a/micrometer-core/src/main/java/io/micrometer/core/instrument/step/StepDistributionSummary.java b/micrometer-core/src/main/java/io/micrometer/core/instrument/step/StepDistributionSummary.java index 027cb1b7e7..b4f576af9b 100644 --- a/micrometer-core/src/main/java/io/micrometer/core/instrument/step/StepDistributionSummary.java +++ b/micrometer-core/src/main/java/io/micrometer/core/instrument/step/StepDistributionSummary.java @@ -47,7 +47,7 @@ public class StepDistributionSummary extends AbstractDistributionSummary impleme * Create a new {@code StepDistributionSummary}. * @param id ID * @param clock clock - * @param distributionStatisticConfig distribution static configuration + * @param distributionStatisticConfig distribution statistic configuration * @param scale scale * @param stepMillis step in milliseconds * @param supportsAggregablePercentiles whether it supports aggregable percentiles @@ -77,7 +77,7 @@ protected StepDistributionSummary(Id id, Clock clock, DistributionStatisticConfi @Override protected void recordNonNegative(double amount) { - count.add(1); + count.add(1L); total.add(amount); max.record(amount); } diff --git a/micrometer-core/src/main/java/io/micrometer/core/instrument/step/StepTimer.java b/micrometer-core/src/main/java/io/micrometer/core/instrument/step/StepTimer.java index fc46f117e3..3861a8e3bf 100644 --- a/micrometer-core/src/main/java/io/micrometer/core/instrument/step/StepTimer.java +++ b/micrometer-core/src/main/java/io/micrometer/core/instrument/step/StepTimer.java @@ -78,7 +78,7 @@ protected StepTimer(final Id id, final Clock clock, final DistributionStatisticC @Override protected void recordNonNegative(final long amount, final TimeUnit unit) { final long nanoAmount = (long) TimeUtils.convert(amount, unit, TimeUnit.NANOSECONDS); - count.add(1); + count.add(1L); total.add(nanoAmount); max.record(nanoAmount); }