From b5d0d08ad8146c3d79885209e49fb60b9ee6be56 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Fri, 19 Aug 2022 07:14:20 -0700 Subject: [PATCH] Fix HistogramScaleBenchmark, use the right ThreadState, clarify difference (#4691) * Fix HistogramScaleBenchmark, use the right ThreadState, clarify difference Signed-off-by: Bogdan Drutu * Update sdk/metrics/src/jmh/java/io/opentelemetry/sdk/metrics/internal/aggregator/HistogramScaleBenchmark.java Co-authored-by: jason plumb <75337021+breedx-splk@users.noreply.github.com> * Update HistogramScaleBenchmark.java Signed-off-by: Bogdan Drutu Co-authored-by: jason plumb <75337021+breedx-splk@users.noreply.github.com> --- .../metrics/internal/aggregator/HistogramScaleBenchmark.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sdk/metrics/src/jmh/java/io/opentelemetry/sdk/metrics/internal/aggregator/HistogramScaleBenchmark.java b/sdk/metrics/src/jmh/java/io/opentelemetry/sdk/metrics/internal/aggregator/HistogramScaleBenchmark.java index e52ca6e88f..ab2bc6b57c 100644 --- a/sdk/metrics/src/jmh/java/io/opentelemetry/sdk/metrics/internal/aggregator/HistogramScaleBenchmark.java +++ b/sdk/metrics/src/jmh/java/io/opentelemetry/sdk/metrics/internal/aggregator/HistogramScaleBenchmark.java @@ -26,7 +26,8 @@ import org.openjdk.jmh.annotations.Warmup; * *

This benchmark must be interpreted carefully. We're looking for startup costs of histograms * and need to tease out the portion of recorded time from scaling buckets vs. general algorithmic - * performance. + * performance. The difference, compared with HistogramBenchmark, is that setup is called before + * each invocation. */ @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) @@ -57,7 +58,7 @@ public class HistogramScaleBenchmark { @Benchmark @Threads(value = 1) - public void scaleUp(HistogramBenchmark.ThreadState threadState) { + public void scaleUp(ThreadState threadState) { threadState.record(); } }