Fix HistogramScaleBenchmark, use the right ThreadState, clarify difference (#4691)

* Fix HistogramScaleBenchmark, use the right ThreadState, clarify difference

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* 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 <bogdandrutu@gmail.com>
Co-authored-by: jason plumb <75337021+breedx-splk@users.noreply.github.com>
This commit is contained in:
Bogdan Drutu 2022-08-19 07:14:20 -07:00 committed by GitHub
parent 734b13e9c5
commit b5d0d08ad8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -26,7 +26,8 @@ import org.openjdk.jmh.annotations.Warmup;
*
* <p>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();
}
}