From 651660f4e9419239ed7f78f865732c2dd5f5f0c1 Mon Sep 17 00:00:00 2001 From: Andrei Sokol Date: Sun, 31 Jan 2021 11:56:36 +0100 Subject: [PATCH 01/10] Add benchmark tests for PrometheusReporter --- prometheus/build.gradle | 18 ++ .../PrometheusReporterBenchmark.java | 157 ++++++++++++++++++ 2 files changed, 175 insertions(+) create mode 100644 prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java diff --git a/prometheus/build.gradle b/prometheus/build.gradle index c90b8c0..e3d3864 100644 --- a/prometheus/build.gradle +++ b/prometheus/build.gradle @@ -23,4 +23,22 @@ description = 'tally Prometheus reporter' dependencies { compile project(':tally-core') compile('io.prometheus:simpleclient:0.9.0') + compile('org.openjdk.jmh:jmh-core:1.27') + compile('org.openjdk.jmh:jmh-generator-annprocess:1.27') } + +sourceSets { + jmh { + java.srcDirs = ['src/jmh/java'] + resources.srcDirs = ['src/jmh/resources'] + compileClasspath += sourceSets.main.runtimeClasspath + compileClasspath += sourceSets.test.runtimeClasspath + } +} + +task jmh(type: JavaExec, dependsOn: jmhClasses) { + main = 'org.openjdk.jmh.Main' + classpath = sourceSets.jmh.compileClasspath + sourceSets.jmh.runtimeClasspath +} + +classes.finalizedBy(jmhClasses) \ No newline at end of file diff --git a/prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java b/prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java new file mode 100644 index 0000000..b7b35d1 --- /dev/null +++ b/prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java @@ -0,0 +1,157 @@ +// Copyright (c) 2021 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package com.uber.m3.tally.prometheus; + +import com.uber.m3.tally.DurationBuckets; +import com.uber.m3.tally.StatsReporter; +import com.uber.m3.tally.ValueBuckets; +import com.uber.m3.util.Duration; +import com.uber.m3.util.ImmutableMap; +import io.prometheus.client.CollectorRegistry; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.TearDown; + +import java.util.concurrent.TimeUnit; + +@BenchmarkMode(Mode.Throughput) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +@Fork(value = 2, jvmArgsAppend = {"-server", "-XX:+UseG1GC"}) +public class PrometheusReporterBenchmark { + + private static final ImmutableMap DEFAULT_TAGS = new ImmutableMap.Builder(5) + .put("tag1", "test1") + .put("tag2", "test2") + .put("tag3", "test3") + .put("tag4", "test4") + .put("env", "test") + .build(); + + private static final DurationBuckets DURATION_EXPONENTIAL_BUCKETS = DurationBuckets.linear( + Duration.ofMillis(1), Duration.ofMillis(10), 128 + ); + + private static final ValueBuckets VALUE_EXPONENTIAL_BUCKETS = ValueBuckets.linear( + 0.1, 100d, 128 + ); + + private static final String COUNTER_NAME = "counter"; + private static final String GAUGE_NAME = "gauge"; + private static final String TIMER_NAME = "timer"; + private static final String HISTOGRAM_DURATION_NAME = "histogram_duration"; + private static final String HISTOGRAM_VALUE_NAME = "histogram_value"; + + @Benchmark + public void reportCounterBenchmark(BenchmarkState state, IncrementalValueState value) { + state.reporter.reportCounter(COUNTER_NAME, DEFAULT_TAGS, value.incrementAndGet()); + } + + @Benchmark + public void reportGaugeBenchmark(BenchmarkState state, IncrementalValueState value) { + state.reporter.reportCounter(COUNTER_NAME, DEFAULT_TAGS, value.incrementAndGet()); + } + + @Benchmark + public void reportTimerBenchmark(BenchmarkState state, IncrementalValueState value) { + state.reporter.reportTimer(TIMER_NAME, DEFAULT_TAGS, Duration.ofSeconds(value.incrementAndGet())); + } + + @Benchmark + public void reportHistogramDurationSamplesBenchmark(BenchmarkState state, IncrementalValueState value) { + state.reporter.reportHistogramDurationSamples( + HISTOGRAM_DURATION_NAME, + DEFAULT_TAGS, + DURATION_EXPONENTIAL_BUCKETS, + DURATION_EXPONENTIAL_BUCKETS.getDurationLowerBoundFor(10), + DURATION_EXPONENTIAL_BUCKETS.getDurationLowerBoundFor(10), + value.incrementAndGet() + ); + } + + @Benchmark + public void reportHistogramValueSamplesBenchmark(BenchmarkState state, IncrementalValueState value) { + state.reporter.reportHistogramValueSamples( + HISTOGRAM_VALUE_NAME, + DEFAULT_TAGS, + VALUE_EXPONENTIAL_BUCKETS, + 5.0, + 5.0, + value.incrementAndGet() + ); + } + + @State(Scope.Benchmark) + public static class BenchmarkState { + + private StatsReporter reporter; + + @Setup + public void setup() { + this.reporter = PrometheusReporter.builder() + .registry(CollectorRegistry.defaultRegistry) + .build(); + + reporter.reportCounter(COUNTER_NAME, DEFAULT_TAGS, 1); + reporter.reportGauge(GAUGE_NAME, DEFAULT_TAGS, 1); + reporter.reportTimer(TIMER_NAME, DEFAULT_TAGS, Duration.ofSeconds(1)); + reporter.reportHistogramValueSamples( + HISTOGRAM_VALUE_NAME, + DEFAULT_TAGS, + VALUE_EXPONENTIAL_BUCKETS, + 0.1, + 0.1, + 1 + ); + reporter.reportHistogramDurationSamples( + HISTOGRAM_DURATION_NAME, + DEFAULT_TAGS, + DURATION_EXPONENTIAL_BUCKETS, + Duration.ofSeconds(1), + Duration.ofSeconds(1), + 1 + ); + } + + @TearDown + public void teardown() { + reporter.close(); + } + + } + + @State(Scope.Thread) + public static class IncrementalValueState { + private long x; + + long incrementAndGet() { + if (x == Long.MAX_VALUE) { + x = 0; + } + return x++; + } + } +} From b153234b3e0db62ec31f84af3623d551e5fcac01 Mon Sep 17 00:00:00 2001 From: Andrei Sokol Date: Sun, 31 Jan 2021 12:14:29 +0100 Subject: [PATCH 02/10] Add benchmark tests for M3Reporter --- .../m3/tally/ReporterTemplateBenchmark.java | 4 + m3/build.gradle | 18 ++ .../uber/m3/tally/m3/M3ReporterBenchmark.java | 160 ++++++++++++++++++ 3 files changed, 182 insertions(+) create mode 100644 core/src/jmh/java/com/uber/m3/tally/ReporterTemplateBenchmark.java create mode 100644 m3/src/jmh/java/com/uber/m3/tally/m3/M3ReporterBenchmark.java diff --git a/core/src/jmh/java/com/uber/m3/tally/ReporterTemplateBenchmark.java b/core/src/jmh/java/com/uber/m3/tally/ReporterTemplateBenchmark.java new file mode 100644 index 0000000..52adc1a --- /dev/null +++ b/core/src/jmh/java/com/uber/m3/tally/ReporterTemplateBenchmark.java @@ -0,0 +1,4 @@ +package com.uber.m3.tally; + +public class ReporterTemplateBenchmark { +} diff --git a/m3/build.gradle b/m3/build.gradle index 3307c7d..3d29a42 100644 --- a/m3/build.gradle +++ b/m3/build.gradle @@ -28,8 +28,26 @@ dependencies { compile('org.apache.thrift:libthrift:0.9.3') compile project(':tally-core') + compile('org.openjdk.jmh:jmh-core:1.27') + compile('org.openjdk.jmh:jmh-generator-annprocess:1.27') } +sourceSets { + jmh { + java.srcDirs = ['src/jmh/java'] + resources.srcDirs = ['src/jmh/resources'] + compileClasspath += sourceSets.main.runtimeClasspath + compileClasspath += sourceSets.test.runtimeClasspath + } +} + +task jmh(type: JavaExec, dependsOn: jmhClasses) { + main = 'org.openjdk.jmh.Main' + classpath = sourceSets.jmh.compileClasspath + sourceSets.jmh.runtimeClasspath +} + +classes.finalizedBy(jmhClasses) + compileThrift { generator 'java', 'private-members' diff --git a/m3/src/jmh/java/com/uber/m3/tally/m3/M3ReporterBenchmark.java b/m3/src/jmh/java/com/uber/m3/tally/m3/M3ReporterBenchmark.java new file mode 100644 index 0000000..391cc33 --- /dev/null +++ b/m3/src/jmh/java/com/uber/m3/tally/m3/M3ReporterBenchmark.java @@ -0,0 +1,160 @@ +// Copyright (c) 2021 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package com.uber.m3.tally.m3; + +import com.uber.m3.tally.DurationBuckets; +import com.uber.m3.tally.StatsReporter; +import com.uber.m3.tally.ValueBuckets; +import com.uber.m3.util.Duration; +import com.uber.m3.util.ImmutableMap; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.TearDown; + +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.util.concurrent.TimeUnit; + +@BenchmarkMode(Mode.Throughput) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +@Fork(value = 2, jvmArgsAppend = {"-server", "-XX:+UseG1GC"}) +public class M3ReporterBenchmark { + + private static final ImmutableMap DEFAULT_TAGS = new ImmutableMap.Builder(5) + .put("tag1", "test1") + .put("tag2", "test2") + .put("tag3", "test3") + .put("tag4", "test4") + .put("env", "test") + .build(); + + private static final DurationBuckets DURATION_EXPONENTIAL_BUCKETS = DurationBuckets.linear( + Duration.ofMillis(1), Duration.ofMillis(10), 128 + ); + + private static final ValueBuckets VALUE_EXPONENTIAL_BUCKETS = ValueBuckets.linear( + 0.1, 100d, 128 + ); + + private static final String COUNTER_NAME = "counter"; + private static final String GAUGE_NAME = "gauge"; + private static final String TIMER_NAME = "timer"; + private static final String HISTOGRAM_DURATION_NAME = "histogram_duration"; + private static final String HISTOGRAM_VALUE_NAME = "histogram_value"; + + @Benchmark + public void reportCounterBenchmark(BenchmarkState state, IncrementalValueState value) { + state.reporter.reportCounter(COUNTER_NAME, DEFAULT_TAGS, value.incrementAndGet()); + } + + @Benchmark + public void reportGaugeBenchmark(BenchmarkState state, IncrementalValueState value) { + state.reporter.reportCounter(COUNTER_NAME, DEFAULT_TAGS, value.incrementAndGet()); + } + + @Benchmark + public void reportTimerBenchmark(BenchmarkState state, IncrementalValueState value) { + state.reporter.reportTimer(TIMER_NAME, DEFAULT_TAGS, Duration.ofSeconds(value.incrementAndGet())); + } + + @Benchmark + public void reportHistogramDurationSamplesBenchmark(BenchmarkState state, IncrementalValueState value) { + state.reporter.reportHistogramDurationSamples( + HISTOGRAM_DURATION_NAME, + DEFAULT_TAGS, + DURATION_EXPONENTIAL_BUCKETS, + DURATION_EXPONENTIAL_BUCKETS.getDurationLowerBoundFor(10), + DURATION_EXPONENTIAL_BUCKETS.getDurationLowerBoundFor(10), + value.incrementAndGet() + ); + } + + @Benchmark + public void reportHistogramValueSamplesBenchmark(BenchmarkState state, IncrementalValueState value) { + state.reporter.reportHistogramValueSamples( + HISTOGRAM_VALUE_NAME, + DEFAULT_TAGS, + VALUE_EXPONENTIAL_BUCKETS, + 5.0, + 5.0, + value.incrementAndGet() + ); + } + + @State(Scope.Benchmark) + public static class BenchmarkState { + + private StatsReporter reporter; + + @Setup + public void setup() { + SocketAddress socketAddress = new InetSocketAddress("127.0.0.1", 12345); + this.reporter = new M3Reporter.Builder(socketAddress) + .service("test-service") + .commonTags(DEFAULT_TAGS) + .build(); + + reporter.reportCounter(COUNTER_NAME, DEFAULT_TAGS, 1); + reporter.reportGauge(GAUGE_NAME, DEFAULT_TAGS, 1); + reporter.reportTimer(TIMER_NAME, DEFAULT_TAGS, Duration.ofSeconds(1)); + reporter.reportHistogramValueSamples( + HISTOGRAM_VALUE_NAME, + DEFAULT_TAGS, + VALUE_EXPONENTIAL_BUCKETS, + 0.1, + 0.1, + 1 + ); + reporter.reportHistogramDurationSamples( + HISTOGRAM_DURATION_NAME, + DEFAULT_TAGS, + DURATION_EXPONENTIAL_BUCKETS, + Duration.ofSeconds(1), + Duration.ofSeconds(1), + 1 + ); + } + + @TearDown + public void teardown() { + reporter.close(); + } + + } + + @State(Scope.Thread) + public static class IncrementalValueState { + private long x; + + long incrementAndGet() { + if (x == Long.MAX_VALUE) { + x = 0; + } + return x++; + } + } +} From 808a13ced13fc80c96f40059bc52e5f0c93ed392 Mon Sep 17 00:00:00 2001 From: Andrei Sokol Date: Sun, 31 Jan 2021 12:49:36 +0100 Subject: [PATCH 03/10] Abstract ReporterBenchmark tests --- core/build.gradle | 4 +- .../m3/tally/ReporterTemplateBenchmark.java | 4 - .../m3/jmh/AbstractReporterBenchmark.java | 143 ++++++++++++++++++ .../uber/m3/tally/m3/M3ReporterBenchmark.java | 132 ++-------------- .../PrometheusReporterBenchmark.java | 127 +--------------- 5 files changed, 161 insertions(+), 249 deletions(-) delete mode 100644 core/src/jmh/java/com/uber/m3/tally/ReporterTemplateBenchmark.java create mode 100644 core/src/main/java/com/uber/m3/jmh/AbstractReporterBenchmark.java diff --git a/core/build.gradle b/core/build.gradle index 555618c..4b0aa1e 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -30,8 +30,8 @@ sourceSets { } dependencies { - jmhImplementation 'org.openjdk.jmh:jmh-core:1.23' - jmhImplementation 'org.openjdk.jmh:jmh-generator-annprocess:1.23' + compile('org.openjdk.jmh:jmh-core:1.27') + compile('org.openjdk.jmh:jmh-generator-annprocess:1.27') } task jmh(type: JavaExec, dependsOn: jmhClasses) { diff --git a/core/src/jmh/java/com/uber/m3/tally/ReporterTemplateBenchmark.java b/core/src/jmh/java/com/uber/m3/tally/ReporterTemplateBenchmark.java deleted file mode 100644 index 52adc1a..0000000 --- a/core/src/jmh/java/com/uber/m3/tally/ReporterTemplateBenchmark.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.uber.m3.tally; - -public class ReporterTemplateBenchmark { -} diff --git a/core/src/main/java/com/uber/m3/jmh/AbstractReporterBenchmark.java b/core/src/main/java/com/uber/m3/jmh/AbstractReporterBenchmark.java new file mode 100644 index 0000000..11f8123 --- /dev/null +++ b/core/src/main/java/com/uber/m3/jmh/AbstractReporterBenchmark.java @@ -0,0 +1,143 @@ +// Copyright (c) 2021 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package com.uber.m3.jmh; + +import com.uber.m3.tally.DurationBuckets; +import com.uber.m3.tally.StatsReporter; +import com.uber.m3.tally.ValueBuckets; +import com.uber.m3.util.Duration; +import com.uber.m3.util.ImmutableMap; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.TearDown; + +// TODO: 31/01/2021 add descrition and readme how to use. +@State(Scope.Benchmark) +public abstract class AbstractReporterBenchmark { + private static final ImmutableMap DEFAULT_TAGS = new ImmutableMap.Builder(5) + .put("tag1", "test1") + .put("tag2", "test2") + .put("tag3", "test3") + .put("tag4", "test4") + .put("env", "test") + .build(); + + private static final DurationBuckets DURATION_EXPONENTIAL_BUCKETS = DurationBuckets.linear( + Duration.ofMillis(1), Duration.ofMillis(10), 128 + ); + + private static final ValueBuckets VALUE_EXPONENTIAL_BUCKETS = ValueBuckets.linear( + 0.1, 100d, 128 + ); + + private static final String COUNTER_NAME = "counter"; + private static final String GAUGE_NAME = "gauge"; + private static final String TIMER_NAME = "timer"; + private static final String HISTOGRAM_DURATION_NAME = "histogram_duration"; + private static final String HISTOGRAM_VALUE_NAME = "histogram_value"; + + private StatsReporter reporter; + + @Benchmark + public void reportCounterBenchmark(IncrementalValueState value) { + reporter.reportCounter(COUNTER_NAME, DEFAULT_TAGS, value.incrementAndGet()); + } + + @Benchmark + public void reportGaugeBenchmark(IncrementalValueState value) { + reporter.reportCounter(COUNTER_NAME, DEFAULT_TAGS, value.incrementAndGet()); + } + + @Benchmark + public void reportTimerBenchmark(IncrementalValueState value) { + reporter.reportTimer(TIMER_NAME, DEFAULT_TAGS, Duration.ofSeconds(value.incrementAndGet())); + } + + @Benchmark + public void reportHistogramDurationSamplesBenchmark(IncrementalValueState value) { + reporter.reportHistogramDurationSamples( + HISTOGRAM_DURATION_NAME, + DEFAULT_TAGS, + DURATION_EXPONENTIAL_BUCKETS, + DURATION_EXPONENTIAL_BUCKETS.getDurationLowerBoundFor(10), + DURATION_EXPONENTIAL_BUCKETS.getDurationLowerBoundFor(10), + value.incrementAndGet() + ); + } + + @Benchmark + public void reportHistogramValueSamplesBenchmark(IncrementalValueState value) { + reporter.reportHistogramValueSamples( + HISTOGRAM_VALUE_NAME, + DEFAULT_TAGS, + VALUE_EXPONENTIAL_BUCKETS, + 5.0, + 5.0, + value.incrementAndGet() + ); + } + + @Setup + public void setup() { + this.reporter = initReporter(); + + reporter.reportCounter(COUNTER_NAME, DEFAULT_TAGS, 1); + reporter.reportGauge(GAUGE_NAME, DEFAULT_TAGS, 1); + reporter.reportTimer(TIMER_NAME, DEFAULT_TAGS, Duration.ofSeconds(1)); + reporter.reportHistogramValueSamples( + HISTOGRAM_VALUE_NAME, + DEFAULT_TAGS, + VALUE_EXPONENTIAL_BUCKETS, + 0.1, + 0.1, + 1 + ); + reporter.reportHistogramDurationSamples( + HISTOGRAM_DURATION_NAME, + DEFAULT_TAGS, + DURATION_EXPONENTIAL_BUCKETS, + Duration.ofSeconds(1), + Duration.ofSeconds(1), + 1 + ); + } + + @TearDown + public void teardown() { + reporter.close(); + } + + public abstract StatsReporter initReporter(); + + @State(Scope.Thread) + public static class IncrementalValueState { + private long x; + + long incrementAndGet() { + if (x == Long.MAX_VALUE) { + x = 0; + } + return x++; + } + } +} diff --git a/m3/src/jmh/java/com/uber/m3/tally/m3/M3ReporterBenchmark.java b/m3/src/jmh/java/com/uber/m3/tally/m3/M3ReporterBenchmark.java index 391cc33..f77ff33 100644 --- a/m3/src/jmh/java/com/uber/m3/tally/m3/M3ReporterBenchmark.java +++ b/m3/src/jmh/java/com/uber/m3/tally/m3/M3ReporterBenchmark.java @@ -20,20 +20,12 @@ package com.uber.m3.tally.m3; -import com.uber.m3.tally.DurationBuckets; +import com.uber.m3.jmh.AbstractReporterBenchmark; import com.uber.m3.tally.StatsReporter; -import com.uber.m3.tally.ValueBuckets; -import com.uber.m3.util.Duration; -import com.uber.m3.util.ImmutableMap; -import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; import org.openjdk.jmh.annotations.Mode; import org.openjdk.jmh.annotations.OutputTimeUnit; -import org.openjdk.jmh.annotations.Scope; -import org.openjdk.jmh.annotations.Setup; -import org.openjdk.jmh.annotations.State; -import org.openjdk.jmh.annotations.TearDown; import java.net.InetSocketAddress; import java.net.SocketAddress; @@ -42,119 +34,13 @@ @BenchmarkMode(Mode.Throughput) @OutputTimeUnit(TimeUnit.MILLISECONDS) @Fork(value = 2, jvmArgsAppend = {"-server", "-XX:+UseG1GC"}) -public class M3ReporterBenchmark { - - private static final ImmutableMap DEFAULT_TAGS = new ImmutableMap.Builder(5) - .put("tag1", "test1") - .put("tag2", "test2") - .put("tag3", "test3") - .put("tag4", "test4") - .put("env", "test") - .build(); - - private static final DurationBuckets DURATION_EXPONENTIAL_BUCKETS = DurationBuckets.linear( - Duration.ofMillis(1), Duration.ofMillis(10), 128 - ); - - private static final ValueBuckets VALUE_EXPONENTIAL_BUCKETS = ValueBuckets.linear( - 0.1, 100d, 128 - ); - - private static final String COUNTER_NAME = "counter"; - private static final String GAUGE_NAME = "gauge"; - private static final String TIMER_NAME = "timer"; - private static final String HISTOGRAM_DURATION_NAME = "histogram_duration"; - private static final String HISTOGRAM_VALUE_NAME = "histogram_value"; - - @Benchmark - public void reportCounterBenchmark(BenchmarkState state, IncrementalValueState value) { - state.reporter.reportCounter(COUNTER_NAME, DEFAULT_TAGS, value.incrementAndGet()); - } - - @Benchmark - public void reportGaugeBenchmark(BenchmarkState state, IncrementalValueState value) { - state.reporter.reportCounter(COUNTER_NAME, DEFAULT_TAGS, value.incrementAndGet()); - } - - @Benchmark - public void reportTimerBenchmark(BenchmarkState state, IncrementalValueState value) { - state.reporter.reportTimer(TIMER_NAME, DEFAULT_TAGS, Duration.ofSeconds(value.incrementAndGet())); - } - - @Benchmark - public void reportHistogramDurationSamplesBenchmark(BenchmarkState state, IncrementalValueState value) { - state.reporter.reportHistogramDurationSamples( - HISTOGRAM_DURATION_NAME, - DEFAULT_TAGS, - DURATION_EXPONENTIAL_BUCKETS, - DURATION_EXPONENTIAL_BUCKETS.getDurationLowerBoundFor(10), - DURATION_EXPONENTIAL_BUCKETS.getDurationLowerBoundFor(10), - value.incrementAndGet() - ); - } - - @Benchmark - public void reportHistogramValueSamplesBenchmark(BenchmarkState state, IncrementalValueState value) { - state.reporter.reportHistogramValueSamples( - HISTOGRAM_VALUE_NAME, - DEFAULT_TAGS, - VALUE_EXPONENTIAL_BUCKETS, - 5.0, - 5.0, - value.incrementAndGet() - ); - } - - @State(Scope.Benchmark) - public static class BenchmarkState { - - private StatsReporter reporter; - - @Setup - public void setup() { - SocketAddress socketAddress = new InetSocketAddress("127.0.0.1", 12345); - this.reporter = new M3Reporter.Builder(socketAddress) - .service("test-service") - .commonTags(DEFAULT_TAGS) - .build(); - - reporter.reportCounter(COUNTER_NAME, DEFAULT_TAGS, 1); - reporter.reportGauge(GAUGE_NAME, DEFAULT_TAGS, 1); - reporter.reportTimer(TIMER_NAME, DEFAULT_TAGS, Duration.ofSeconds(1)); - reporter.reportHistogramValueSamples( - HISTOGRAM_VALUE_NAME, - DEFAULT_TAGS, - VALUE_EXPONENTIAL_BUCKETS, - 0.1, - 0.1, - 1 - ); - reporter.reportHistogramDurationSamples( - HISTOGRAM_DURATION_NAME, - DEFAULT_TAGS, - DURATION_EXPONENTIAL_BUCKETS, - Duration.ofSeconds(1), - Duration.ofSeconds(1), - 1 - ); - } - - @TearDown - public void teardown() { - reporter.close(); - } - - } - - @State(Scope.Thread) - public static class IncrementalValueState { - private long x; - - long incrementAndGet() { - if (x == Long.MAX_VALUE) { - x = 0; - } - return x++; - } +public class M3ReporterBenchmark extends AbstractReporterBenchmark { + + @Override + public StatsReporter initReporter() { + SocketAddress socketAddress = new InetSocketAddress("127.0.0.1", 12345); + return new M3Reporter.Builder(socketAddress) + .service("test-service") + .build(); } } diff --git a/prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java b/prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java index b7b35d1..9671cf1 100644 --- a/prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java +++ b/prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java @@ -20,138 +20,25 @@ package com.uber.m3.tally.prometheus; -import com.uber.m3.tally.DurationBuckets; +import com.uber.m3.jmh.AbstractReporterBenchmark; import com.uber.m3.tally.StatsReporter; -import com.uber.m3.tally.ValueBuckets; -import com.uber.m3.util.Duration; -import com.uber.m3.util.ImmutableMap; import io.prometheus.client.CollectorRegistry; -import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; import org.openjdk.jmh.annotations.Mode; import org.openjdk.jmh.annotations.OutputTimeUnit; -import org.openjdk.jmh.annotations.Scope; -import org.openjdk.jmh.annotations.Setup; -import org.openjdk.jmh.annotations.State; -import org.openjdk.jmh.annotations.TearDown; import java.util.concurrent.TimeUnit; @BenchmarkMode(Mode.Throughput) @OutputTimeUnit(TimeUnit.MILLISECONDS) @Fork(value = 2, jvmArgsAppend = {"-server", "-XX:+UseG1GC"}) -public class PrometheusReporterBenchmark { +public class PrometheusReporterBenchmark extends AbstractReporterBenchmark { - private static final ImmutableMap DEFAULT_TAGS = new ImmutableMap.Builder(5) - .put("tag1", "test1") - .put("tag2", "test2") - .put("tag3", "test3") - .put("tag4", "test4") - .put("env", "test") - .build(); - - private static final DurationBuckets DURATION_EXPONENTIAL_BUCKETS = DurationBuckets.linear( - Duration.ofMillis(1), Duration.ofMillis(10), 128 - ); - - private static final ValueBuckets VALUE_EXPONENTIAL_BUCKETS = ValueBuckets.linear( - 0.1, 100d, 128 - ); - - private static final String COUNTER_NAME = "counter"; - private static final String GAUGE_NAME = "gauge"; - private static final String TIMER_NAME = "timer"; - private static final String HISTOGRAM_DURATION_NAME = "histogram_duration"; - private static final String HISTOGRAM_VALUE_NAME = "histogram_value"; - - @Benchmark - public void reportCounterBenchmark(BenchmarkState state, IncrementalValueState value) { - state.reporter.reportCounter(COUNTER_NAME, DEFAULT_TAGS, value.incrementAndGet()); - } - - @Benchmark - public void reportGaugeBenchmark(BenchmarkState state, IncrementalValueState value) { - state.reporter.reportCounter(COUNTER_NAME, DEFAULT_TAGS, value.incrementAndGet()); - } - - @Benchmark - public void reportTimerBenchmark(BenchmarkState state, IncrementalValueState value) { - state.reporter.reportTimer(TIMER_NAME, DEFAULT_TAGS, Duration.ofSeconds(value.incrementAndGet())); - } - - @Benchmark - public void reportHistogramDurationSamplesBenchmark(BenchmarkState state, IncrementalValueState value) { - state.reporter.reportHistogramDurationSamples( - HISTOGRAM_DURATION_NAME, - DEFAULT_TAGS, - DURATION_EXPONENTIAL_BUCKETS, - DURATION_EXPONENTIAL_BUCKETS.getDurationLowerBoundFor(10), - DURATION_EXPONENTIAL_BUCKETS.getDurationLowerBoundFor(10), - value.incrementAndGet() - ); - } - - @Benchmark - public void reportHistogramValueSamplesBenchmark(BenchmarkState state, IncrementalValueState value) { - state.reporter.reportHistogramValueSamples( - HISTOGRAM_VALUE_NAME, - DEFAULT_TAGS, - VALUE_EXPONENTIAL_BUCKETS, - 5.0, - 5.0, - value.incrementAndGet() - ); - } - - @State(Scope.Benchmark) - public static class BenchmarkState { - - private StatsReporter reporter; - - @Setup - public void setup() { - this.reporter = PrometheusReporter.builder() - .registry(CollectorRegistry.defaultRegistry) - .build(); - - reporter.reportCounter(COUNTER_NAME, DEFAULT_TAGS, 1); - reporter.reportGauge(GAUGE_NAME, DEFAULT_TAGS, 1); - reporter.reportTimer(TIMER_NAME, DEFAULT_TAGS, Duration.ofSeconds(1)); - reporter.reportHistogramValueSamples( - HISTOGRAM_VALUE_NAME, - DEFAULT_TAGS, - VALUE_EXPONENTIAL_BUCKETS, - 0.1, - 0.1, - 1 - ); - reporter.reportHistogramDurationSamples( - HISTOGRAM_DURATION_NAME, - DEFAULT_TAGS, - DURATION_EXPONENTIAL_BUCKETS, - Duration.ofSeconds(1), - Duration.ofSeconds(1), - 1 - ); - } - - @TearDown - public void teardown() { - reporter.close(); - } - - } - - @State(Scope.Thread) - public static class IncrementalValueState { - private long x; - - long incrementAndGet() { - if (x == Long.MAX_VALUE) { - x = 0; - } - return x++; - } + @Override + public StatsReporter initReporter() { + return PrometheusReporter.builder() + .registry(CollectorRegistry.defaultRegistry) + .build(); } } From 923a6c3121709a3bb3b84b29ae9a978d68f2871a Mon Sep 17 00:00:00 2001 From: Andrei Sokol Date: Sun, 31 Jan 2021 21:53:13 +0100 Subject: [PATCH 04/10] Add benchmark tests for StatsdReporter --- statsd/build.gradle | 18 ++++++++ .../tally/statsd/StatsdReporterBenchmark.java | 43 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 statsd/src/jmh/java/com/uber/m3/tally/statsd/StatsdReporterBenchmark.java diff --git a/statsd/build.gradle b/statsd/build.gradle index e9e7d66..728844a 100644 --- a/statsd/build.gradle +++ b/statsd/build.gradle @@ -23,4 +23,22 @@ description = 'tally StatsD reporter' dependencies { compile project(':tally-core') compile('com.datadoghq:java-dogstatsd-client:2.3') + compile('org.openjdk.jmh:jmh-core:1.27') + compile('org.openjdk.jmh:jmh-generator-annprocess:1.27') } + +sourceSets { + jmh { + java.srcDirs = ['src/jmh/java'] + resources.srcDirs = ['src/jmh/resources'] + compileClasspath += sourceSets.main.runtimeClasspath + compileClasspath += sourceSets.test.runtimeClasspath + } +} + +task jmh(type: JavaExec, dependsOn: jmhClasses) { + main = 'org.openjdk.jmh.Main' + classpath = sourceSets.jmh.compileClasspath + sourceSets.jmh.runtimeClasspath +} + +classes.finalizedBy(jmhClasses) diff --git a/statsd/src/jmh/java/com/uber/m3/tally/statsd/StatsdReporterBenchmark.java b/statsd/src/jmh/java/com/uber/m3/tally/statsd/StatsdReporterBenchmark.java new file mode 100644 index 0000000..2f84a63 --- /dev/null +++ b/statsd/src/jmh/java/com/uber/m3/tally/statsd/StatsdReporterBenchmark.java @@ -0,0 +1,43 @@ +// Copyright (c) 2021 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package com.uber.m3.tally.statsd; + +import com.timgroup.statsd.NonBlockingStatsDClient; +import com.timgroup.statsd.StatsDClient; +import com.uber.m3.jmh.AbstractReporterBenchmark; +import com.uber.m3.tally.StatsReporter; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; + +import java.util.concurrent.TimeUnit; + +@BenchmarkMode(Mode.Throughput) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +@Fork(value = 2, jvmArgsAppend = {"-server", "-XX:+UseG1GC"}) +public class StatsdReporterBenchmark extends AbstractReporterBenchmark { + @Override + public StatsReporter initReporter() { + StatsDClient statsd = new NonBlockingStatsDClient("statsd-test", "localhost", 1235); + return new StatsdReporter(statsd); + } +} From 14aae1dca0a230b5594d43329ce56dc2ac1b0743 Mon Sep 17 00:00:00 2001 From: Andrei Sokol Date: Mon, 1 Feb 2021 14:13:30 +0100 Subject: [PATCH 05/10] Move AbstractReporterBenchmark to jmh module --- core/build.gradle | 15 ++--- core/jmhFixtures.gradle | 58 +++++++++++++++++++ .../m3/tally}/AbstractReporterBenchmark.java | 5 +- m3/build.gradle | 7 +-- .../uber/m3/tally/m3/M3ReporterBenchmark.java | 4 +- prometheus/build.gradle | 8 +-- .../PrometheusReporterBenchmark.java | 2 +- statsd/build.gradle | 6 +- .../tally/statsd/StatsdReporterBenchmark.java | 2 +- 9 files changed, 79 insertions(+), 28 deletions(-) create mode 100644 core/jmhFixtures.gradle rename core/src/{main/java/com/uber/m3/jmh => jmh/java/com/uber/m3/tally}/AbstractReporterBenchmark.java (97%) diff --git a/core/build.gradle b/core/build.gradle index 4b0aa1e..ce74fb3 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -19,6 +19,12 @@ // THE SOFTWARE. description = 'Interfaces and utilities to report metrics to M3' +apply from: 'jmhFixtures.gradle' + +//dependencies { +// jmhCompile('org.openjdk.jmh:jmh-core:1.27') +// jmhCompile('org.openjdk.jmh:jmh-generator-annprocess:1.27') +//} sourceSets { jmh { @@ -29,14 +35,9 @@ sourceSets { } } -dependencies { - compile('org.openjdk.jmh:jmh-core:1.27') - compile('org.openjdk.jmh:jmh-generator-annprocess:1.27') -} - -task jmh(type: JavaExec, dependsOn: jmhClasses) { +task runJmhTests(type: JavaExec, dependsOn: jmhClasses) { main = 'org.openjdk.jmh.Main' classpath = sourceSets.jmh.compileClasspath + sourceSets.jmh.runtimeClasspath } -classes.finalizedBy(jmhClasses) +classes.finalizedBy(jmhClasses) \ No newline at end of file diff --git a/core/jmhFixtures.gradle b/core/jmhFixtures.gradle new file mode 100644 index 0000000..aafc1d1 --- /dev/null +++ b/core/jmhFixtures.gradle @@ -0,0 +1,58 @@ +// Copyright (c) 2021 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +description = 'Script plugin to add jmh dependencies to other modules' +apply plugin: 'java' + +configurations { + outputDirs + + // This configuration holds dependencies to libraries or another projects + // and will be placed on jmhFixtures source set's classpath. + jmhFixturesCompile.extendsFrom compile + jmhFixturesRuntime.extendsFrom runtime, jmhFixturesCompile + + // Following two configurations adds compiled jmhFixtures classes to the + // jmhFixtures* source sets so it can be used by other projects as a + // dependency target. + jmhFixturesUsageCompile.extendsFrom jmhFixturesCompile, outputDirs + jmhFixturesUsageRuntime.extendsFrom jmhFixturesRuntime, jmhFixturesUsageCompile +} + +sourceSets { + jmh { + java.srcDirs = ['src/jmh/java'] + java.exclude('**/ScopeImplBenchmark.java') + resources.srcDirs = ['src/jmh/resources'] + compileClasspath += sourceSets.main.output + compileClasspath += configurations.jmhFixturesCompile + compileClasspath += sourceSets.main.runtimeClasspath + compileClasspath += sourceSets.test.runtimeClasspath + runtimeClasspath = output + compileClasspath + configurations.jmhFixturesRuntime + } + +} + +dependencies { + outputDirs sourceSets.jmh.output + jmhFixturesUsageCompile project(project.path) + jmhFixturesCompile('org.openjdk.jmh:jmh-core:1.27') + jmhFixturesCompile('org.openjdk.jmh:jmh-generator-annprocess:1.27') +} diff --git a/core/src/main/java/com/uber/m3/jmh/AbstractReporterBenchmark.java b/core/src/jmh/java/com/uber/m3/tally/AbstractReporterBenchmark.java similarity index 97% rename from core/src/main/java/com/uber/m3/jmh/AbstractReporterBenchmark.java rename to core/src/jmh/java/com/uber/m3/tally/AbstractReporterBenchmark.java index 11f8123..dc4051c 100644 --- a/core/src/main/java/com/uber/m3/jmh/AbstractReporterBenchmark.java +++ b/core/src/jmh/java/com/uber/m3/tally/AbstractReporterBenchmark.java @@ -18,11 +18,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.uber.m3.jmh; +package com.uber.m3.tally; -import com.uber.m3.tally.DurationBuckets; -import com.uber.m3.tally.StatsReporter; -import com.uber.m3.tally.ValueBuckets; import com.uber.m3.util.Duration; import com.uber.m3.util.ImmutableMap; import org.openjdk.jmh.annotations.Benchmark; diff --git a/m3/build.gradle b/m3/build.gradle index 3d29a42..22c3c05 100644 --- a/m3/build.gradle +++ b/m3/build.gradle @@ -26,10 +26,7 @@ description = 'tally M3 reporter' dependencies { compile('org.apache.thrift:libthrift:0.9.3') - - compile project(':tally-core') - compile('org.openjdk.jmh:jmh-core:1.27') - compile('org.openjdk.jmh:jmh-generator-annprocess:1.27') + compile project(path: ':tally-core', configuration: 'jmhFixturesUsageCompile') } sourceSets { @@ -41,7 +38,7 @@ sourceSets { } } -task jmh(type: JavaExec, dependsOn: jmhClasses) { +task runJmhTests(type: JavaExec, dependsOn: jmhClasses) { main = 'org.openjdk.jmh.Main' classpath = sourceSets.jmh.compileClasspath + sourceSets.jmh.runtimeClasspath } diff --git a/m3/src/jmh/java/com/uber/m3/tally/m3/M3ReporterBenchmark.java b/m3/src/jmh/java/com/uber/m3/tally/m3/M3ReporterBenchmark.java index f77ff33..3343dbb 100644 --- a/m3/src/jmh/java/com/uber/m3/tally/m3/M3ReporterBenchmark.java +++ b/m3/src/jmh/java/com/uber/m3/tally/m3/M3ReporterBenchmark.java @@ -20,8 +20,9 @@ package com.uber.m3.tally.m3; -import com.uber.m3.jmh.AbstractReporterBenchmark; +import com.uber.m3.tally.AbstractReporterBenchmark; import com.uber.m3.tally.StatsReporter; +import com.uber.m3.util.ImmutableMap; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; import org.openjdk.jmh.annotations.Mode; @@ -41,6 +42,7 @@ public StatsReporter initReporter() { SocketAddress socketAddress = new InetSocketAddress("127.0.0.1", 12345); return new M3Reporter.Builder(socketAddress) .service("test-service") + .commonTags(ImmutableMap.of("env", "test")) .build(); } } diff --git a/prometheus/build.gradle b/prometheus/build.gradle index e3d3864..fae72be 100644 --- a/prometheus/build.gradle +++ b/prometheus/build.gradle @@ -21,10 +21,8 @@ description = 'tally Prometheus reporter' dependencies { - compile project(':tally-core') compile('io.prometheus:simpleclient:0.9.0') - compile('org.openjdk.jmh:jmh-core:1.27') - compile('org.openjdk.jmh:jmh-generator-annprocess:1.27') + compile project(path: ':tally-core', configuration: 'jmhFixturesUsageCompile') } sourceSets { @@ -36,9 +34,9 @@ sourceSets { } } -task jmh(type: JavaExec, dependsOn: jmhClasses) { +task runJmhTests(type: JavaExec, dependsOn: jmhClasses) { main = 'org.openjdk.jmh.Main' classpath = sourceSets.jmh.compileClasspath + sourceSets.jmh.runtimeClasspath } -classes.finalizedBy(jmhClasses) \ No newline at end of file +classes.finalizedBy(jmhClasses) diff --git a/prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java b/prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java index 9671cf1..b6123c1 100644 --- a/prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java +++ b/prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java @@ -20,7 +20,7 @@ package com.uber.m3.tally.prometheus; -import com.uber.m3.jmh.AbstractReporterBenchmark; +import com.uber.m3.tally.AbstractReporterBenchmark; import com.uber.m3.tally.StatsReporter; import io.prometheus.client.CollectorRegistry; import org.openjdk.jmh.annotations.BenchmarkMode; diff --git a/statsd/build.gradle b/statsd/build.gradle index 728844a..b2a6c1b 100644 --- a/statsd/build.gradle +++ b/statsd/build.gradle @@ -21,10 +21,8 @@ description = 'tally StatsD reporter' dependencies { - compile project(':tally-core') compile('com.datadoghq:java-dogstatsd-client:2.3') - compile('org.openjdk.jmh:jmh-core:1.27') - compile('org.openjdk.jmh:jmh-generator-annprocess:1.27') + compile project(path: ':tally-core', configuration: 'jmhFixturesUsageCompile') } sourceSets { @@ -36,7 +34,7 @@ sourceSets { } } -task jmh(type: JavaExec, dependsOn: jmhClasses) { +task runJmhTests(type: JavaExec, dependsOn: jmhClasses) { main = 'org.openjdk.jmh.Main' classpath = sourceSets.jmh.compileClasspath + sourceSets.jmh.runtimeClasspath } diff --git a/statsd/src/jmh/java/com/uber/m3/tally/statsd/StatsdReporterBenchmark.java b/statsd/src/jmh/java/com/uber/m3/tally/statsd/StatsdReporterBenchmark.java index 2f84a63..e73ce71 100644 --- a/statsd/src/jmh/java/com/uber/m3/tally/statsd/StatsdReporterBenchmark.java +++ b/statsd/src/jmh/java/com/uber/m3/tally/statsd/StatsdReporterBenchmark.java @@ -22,7 +22,7 @@ import com.timgroup.statsd.NonBlockingStatsDClient; import com.timgroup.statsd.StatsDClient; -import com.uber.m3.jmh.AbstractReporterBenchmark; +import com.uber.m3.tally.AbstractReporterBenchmark; import com.uber.m3.tally.StatsReporter; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; From 1cf6397b2b300688bc6f91514c21be6089b9c22b Mon Sep 17 00:00:00 2001 From: Andrei Sokol Date: Mon, 1 Feb 2021 14:19:03 +0100 Subject: [PATCH 06/10] Add tests results into README.md --- m3/README.md | 8 ++++++++ prometheus/README.md | 8 ++++++++ statsd/README.md | 8 ++++++++ 3 files changed, 24 insertions(+) create mode 100644 m3/README.md create mode 100644 prometheus/README.md create mode 100644 statsd/README.md diff --git a/m3/README.md b/m3/README.md new file mode 100644 index 0000000..2d94a9d --- /dev/null +++ b/m3/README.md @@ -0,0 +1,8 @@ +# JMH Benchmark Tests results + +Benchmark Mode Cnt Score Error Units +M3ReporterBenchmark.reportCounterBenchmark thrpt 10 391.795 ± 38.909 ops/ms +M3ReporterBenchmark.reportGaugeBenchmark thrpt 10 439.604 ± 50.595 ops/ms +M3ReporterBenchmark.reportHistogramDurationSamplesBenchmark thrpt 10 146.534 ± 18.504 ops/ms +M3ReporterBenchmark.reportHistogramValueSamplesBenchmark thrpt 10 121.296 ± 10.906 ops/ms +M3ReporterBenchmark.reportTimerBenchmark thrpt 10 430.241 ± 46.184 ops/ms diff --git a/prometheus/README.md b/prometheus/README.md new file mode 100644 index 0000000..6049622 --- /dev/null +++ b/prometheus/README.md @@ -0,0 +1,8 @@ +# JMH Benchmark Tests Results + +Benchmark Mode Cnt Score Error Units +PrometheusReporterBenchmark.reportCounterBenchmark thrpt 10 243.828 ± 5.643 ops/ms +PrometheusReporterBenchmark.reportGaugeBenchmark thrpt 10 247.080 ± 5.012 ops/ms +PrometheusReporterBenchmark.reportHistogramDurationSamplesBenchmark thrpt 10 0.694 ± 0.114 ops/ms +PrometheusReporterBenchmark.reportHistogramValueSamplesBenchmark thrpt 10 0.731 ± 0.089 ops/ms +PrometheusReporterBenchmark.reportTimerBenchmark thrpt 10 57.263 ± 9.743 ops/ms \ No newline at end of file diff --git a/statsd/README.md b/statsd/README.md new file mode 100644 index 0000000..669951d --- /dev/null +++ b/statsd/README.md @@ -0,0 +1,8 @@ +# JMH Benchmark Tests results + +Benchmark Mode Cnt Score Error Units +StatsdReporterBenchmark.reportCounterBenchmark thrpt 10 411.498 ± 69.192 ops/ms +StatsdReporterBenchmark.reportGaugeBenchmark thrpt 10 273.496 ± 47.997 ops/ms +StatsdReporterBenchmark.reportHistogramDurationSamplesBenchmark thrpt 10 137.606 ± 53.928 ops/ms +StatsdReporterBenchmark.reportHistogramValueSamplesBenchmark thrpt 10 91.010 ± 25.876 ops/ms +StatsdReporterBenchmark.reportTimerBenchmark thrpt 10 402.208 ± 206.062 ops/ms \ No newline at end of file From 07df1eb58206f6e52d7765906f22f9b6463681f5 Mon Sep 17 00:00:00 2001 From: Andrei Sokol Date: Mon, 1 Feb 2021 16:30:04 +0100 Subject: [PATCH 07/10] Fix core tests --- core/build.gradle | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/core/build.gradle b/core/build.gradle index ce74fb3..7e547bc 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -21,14 +21,11 @@ description = 'Interfaces and utilities to report metrics to M3' apply from: 'jmhFixtures.gradle' -//dependencies { -// jmhCompile('org.openjdk.jmh:jmh-core:1.27') -// jmhCompile('org.openjdk.jmh:jmh-generator-annprocess:1.27') -//} - sourceSets { jmh { java.srcDirs = ['src/jmh/java'] +// explicitly disable excludes so that JMH tests from core module can be run + java.setExcludes([]) resources.srcDirs = ['src/jmh/resources'] compileClasspath += sourceSets.main.runtimeClasspath compileClasspath += sourceSets.test.runtimeClasspath From 7b7b2fffeb6c4a3560657024beb158e790e68d63 Mon Sep 17 00:00:00 2001 From: Andrei Sokol Date: Mon, 8 Feb 2021 17:40:11 +0100 Subject: [PATCH 08/10] Add automatic reporting and docs for jmh test --- DEVELOPER.md | 14 ++++++++++++++ core/build.gradle | 8 ++++++-- core/jmhFixtures.gradle | 1 - .../uber/m3/tally/AbstractReporterBenchmark.java | 15 ++++++++++++++- m3/build.gradle | 8 ++++++++ .../com/uber/m3/tally/m3/M3ReporterBenchmark.java | 8 -------- prometheus/build.gradle | 8 ++++++++ .../prometheus/PrometheusReporterBenchmark.java | 9 --------- statsd/build.gradle | 8 ++++++++ .../m3/tally/statsd/StatsdReporterBenchmark.java | 9 --------- 10 files changed, 58 insertions(+), 30 deletions(-) diff --git a/DEVELOPER.md b/DEVELOPER.md index 8be7c8e..1df8e50 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -20,6 +20,20 @@ To run the project's tests: ./gradlew check ``` +To run the JMH benchmark tests: +```bash +./gradlew runJmhTests +``` + +By default, the benchmark test results are writen to `build/reports/jmh/result.json`. +Use `output` input parameter to configure the output path. +E.g. the following command will run the benchmark tests for `tally-prometheus` sun-project and store +the results to `custom/path/result.json`. +```bash +./gradlew :tally-prometheus:runJmhTests -Poutput="custom/path/result.json" +``` + + By default, the build does *not* compile Thrift files to generate sources. If you make changes to Thrift files and need regenerate sources, make sure you have thrift 0.9.x installed and build with the `genThrift` property set, e.g. ```bash diff --git a/core/build.gradle b/core/build.gradle index 7e547bc..ba762ea 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -24,8 +24,6 @@ apply from: 'jmhFixtures.gradle' sourceSets { jmh { java.srcDirs = ['src/jmh/java'] -// explicitly disable excludes so that JMH tests from core module can be run - java.setExcludes([]) resources.srcDirs = ['src/jmh/resources'] compileClasspath += sourceSets.main.runtimeClasspath compileClasspath += sourceSets.test.runtimeClasspath @@ -35,6 +33,12 @@ sourceSets { task runJmhTests(type: JavaExec, dependsOn: jmhClasses) { main = 'org.openjdk.jmh.Main' classpath = sourceSets.jmh.compileClasspath + sourceSets.jmh.runtimeClasspath + def resultFilePath = project.properties.get('output', 'build/reports/jmh/result.json'); + def resultFile = file(resultFilePath) + resultFile.parentFile.mkdirs() + + args '-rf', 'json' + args '-rff', resultFile } classes.finalizedBy(jmhClasses) \ No newline at end of file diff --git a/core/jmhFixtures.gradle b/core/jmhFixtures.gradle index aafc1d1..30c6bec 100644 --- a/core/jmhFixtures.gradle +++ b/core/jmhFixtures.gradle @@ -39,7 +39,6 @@ configurations { sourceSets { jmh { java.srcDirs = ['src/jmh/java'] - java.exclude('**/ScopeImplBenchmark.java') resources.srcDirs = ['src/jmh/resources'] compileClasspath += sourceSets.main.output compileClasspath += configurations.jmhFixturesCompile diff --git a/core/src/jmh/java/com/uber/m3/tally/AbstractReporterBenchmark.java b/core/src/jmh/java/com/uber/m3/tally/AbstractReporterBenchmark.java index dc4051c..c81a5ca 100644 --- a/core/src/jmh/java/com/uber/m3/tally/AbstractReporterBenchmark.java +++ b/core/src/jmh/java/com/uber/m3/tally/AbstractReporterBenchmark.java @@ -23,12 +23,25 @@ import com.uber.m3.util.Duration; import com.uber.m3.util.ImmutableMap; import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; import org.openjdk.jmh.annotations.Scope; import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.TearDown; -// TODO: 31/01/2021 add descrition and readme how to use. +import java.util.concurrent.TimeUnit; + +/** + * Abstract class for {@link StatsReporter} benchmark tests. + * If you're adding a new implementation of {@link StatsReporter} you should include benchmark tests in your code. + * See `com.uber.m3.tally.m3.M3ReporterBenchmark` for an example. + */ +@BenchmarkMode(Mode.Throughput) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +@Fork(value = 2, jvmArgsAppend = {"-server", "-XX:+UseG1GC"}) @State(Scope.Benchmark) public abstract class AbstractReporterBenchmark { private static final ImmutableMap DEFAULT_TAGS = new ImmutableMap.Builder(5) diff --git a/m3/build.gradle b/m3/build.gradle index 22c3c05..7afb822 100644 --- a/m3/build.gradle +++ b/m3/build.gradle @@ -41,6 +41,14 @@ sourceSets { task runJmhTests(type: JavaExec, dependsOn: jmhClasses) { main = 'org.openjdk.jmh.Main' classpath = sourceSets.jmh.compileClasspath + sourceSets.jmh.runtimeClasspath + def resultFilePath = project.properties.get('output', 'build/reports/jmh/result.json'); + def resultFile = file(resultFilePath) + resultFile.parentFile.mkdirs() + + // ScopeImplBenchmark is shipped as a part of jmh source-set from :tally-core. Explicitly exclude it from running. + args '-e', '.*ScopeImplBenchmark.*' + args '-rf', 'json' + args '-rff', resultFile } classes.finalizedBy(jmhClasses) diff --git a/m3/src/jmh/java/com/uber/m3/tally/m3/M3ReporterBenchmark.java b/m3/src/jmh/java/com/uber/m3/tally/m3/M3ReporterBenchmark.java index 3343dbb..b223701 100644 --- a/m3/src/jmh/java/com/uber/m3/tally/m3/M3ReporterBenchmark.java +++ b/m3/src/jmh/java/com/uber/m3/tally/m3/M3ReporterBenchmark.java @@ -23,18 +23,10 @@ import com.uber.m3.tally.AbstractReporterBenchmark; import com.uber.m3.tally.StatsReporter; import com.uber.m3.util.ImmutableMap; -import org.openjdk.jmh.annotations.BenchmarkMode; -import org.openjdk.jmh.annotations.Fork; -import org.openjdk.jmh.annotations.Mode; -import org.openjdk.jmh.annotations.OutputTimeUnit; import java.net.InetSocketAddress; import java.net.SocketAddress; -import java.util.concurrent.TimeUnit; -@BenchmarkMode(Mode.Throughput) -@OutputTimeUnit(TimeUnit.MILLISECONDS) -@Fork(value = 2, jvmArgsAppend = {"-server", "-XX:+UseG1GC"}) public class M3ReporterBenchmark extends AbstractReporterBenchmark { @Override diff --git a/prometheus/build.gradle b/prometheus/build.gradle index fae72be..ffeee8a 100644 --- a/prometheus/build.gradle +++ b/prometheus/build.gradle @@ -37,6 +37,14 @@ sourceSets { task runJmhTests(type: JavaExec, dependsOn: jmhClasses) { main = 'org.openjdk.jmh.Main' classpath = sourceSets.jmh.compileClasspath + sourceSets.jmh.runtimeClasspath + def resultFilePath = project.properties.get('output', 'build/reports/jmh/result.json'); + def resultFile = file(resultFilePath) + resultFile.parentFile.mkdirs() + + // ScopeImplBenchmark is shipped as a part of jmh source-set from :tally-core. Explicitly exclude it from running. + args '-e', '.*ScopeImplBenchmark.*' + args '-rf', 'json' + args '-rff', resultFile } classes.finalizedBy(jmhClasses) diff --git a/prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java b/prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java index b6123c1..fd60596 100644 --- a/prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java +++ b/prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java @@ -23,16 +23,7 @@ import com.uber.m3.tally.AbstractReporterBenchmark; import com.uber.m3.tally.StatsReporter; import io.prometheus.client.CollectorRegistry; -import org.openjdk.jmh.annotations.BenchmarkMode; -import org.openjdk.jmh.annotations.Fork; -import org.openjdk.jmh.annotations.Mode; -import org.openjdk.jmh.annotations.OutputTimeUnit; -import java.util.concurrent.TimeUnit; - -@BenchmarkMode(Mode.Throughput) -@OutputTimeUnit(TimeUnit.MILLISECONDS) -@Fork(value = 2, jvmArgsAppend = {"-server", "-XX:+UseG1GC"}) public class PrometheusReporterBenchmark extends AbstractReporterBenchmark { @Override diff --git a/statsd/build.gradle b/statsd/build.gradle index b2a6c1b..c3b1bcb 100644 --- a/statsd/build.gradle +++ b/statsd/build.gradle @@ -37,6 +37,14 @@ sourceSets { task runJmhTests(type: JavaExec, dependsOn: jmhClasses) { main = 'org.openjdk.jmh.Main' classpath = sourceSets.jmh.compileClasspath + sourceSets.jmh.runtimeClasspath + def resultFilePath = project.properties.get('output', 'build/reports/jmh/result.json'); + def resultFile = file(resultFilePath) + resultFile.parentFile.mkdirs() + + // ScopeImplBenchmark is shipped as a part of jmh source-set from :tally-core. Explicitly exclude it from running. + args '-e', '.*ScopeImplBenchmark.*' + args '-rf', 'json' + args '-rff', resultFile } classes.finalizedBy(jmhClasses) diff --git a/statsd/src/jmh/java/com/uber/m3/tally/statsd/StatsdReporterBenchmark.java b/statsd/src/jmh/java/com/uber/m3/tally/statsd/StatsdReporterBenchmark.java index e73ce71..45b0d52 100644 --- a/statsd/src/jmh/java/com/uber/m3/tally/statsd/StatsdReporterBenchmark.java +++ b/statsd/src/jmh/java/com/uber/m3/tally/statsd/StatsdReporterBenchmark.java @@ -24,16 +24,7 @@ import com.timgroup.statsd.StatsDClient; import com.uber.m3.tally.AbstractReporterBenchmark; import com.uber.m3.tally.StatsReporter; -import org.openjdk.jmh.annotations.BenchmarkMode; -import org.openjdk.jmh.annotations.Fork; -import org.openjdk.jmh.annotations.Mode; -import org.openjdk.jmh.annotations.OutputTimeUnit; -import java.util.concurrent.TimeUnit; - -@BenchmarkMode(Mode.Throughput) -@OutputTimeUnit(TimeUnit.MILLISECONDS) -@Fork(value = 2, jvmArgsAppend = {"-server", "-XX:+UseG1GC"}) public class StatsdReporterBenchmark extends AbstractReporterBenchmark { @Override public StatsReporter initReporter() { From ff6d01290cacc6f5eb49e3bb1835c11e922c2367 Mon Sep 17 00:00:00 2001 From: Andrei Sokol Date: Tue, 9 Feb 2021 01:19:18 +0100 Subject: [PATCH 09/10] Add gc profiling --- DEVELOPER.md | 8 +++--- core/build.gradle | 4 +-- m3/README.md | 8 ------ m3/benchmark-tests.txt | 52 ++++++++++++++++++++++++++++++++++ m3/build.gradle | 5 ++-- prometheus/README.md | 8 ------ prometheus/benchmark-tests.txt | 44 ++++++++++++++++++++++++++++ prometheus/build.gradle | 5 ++-- statsd/README.md | 8 ------ statsd/benchmark-tests.txt | 46 ++++++++++++++++++++++++++++++ statsd/build.gradle | 5 ++-- 11 files changed, 157 insertions(+), 36 deletions(-) delete mode 100644 m3/README.md create mode 100644 m3/benchmark-tests.txt delete mode 100644 prometheus/README.md create mode 100644 prometheus/benchmark-tests.txt delete mode 100644 statsd/README.md create mode 100644 statsd/benchmark-tests.txt diff --git a/DEVELOPER.md b/DEVELOPER.md index 1df8e50..182d194 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -25,12 +25,12 @@ To run the JMH benchmark tests: ./gradlew runJmhTests ``` -By default, the benchmark test results are writen to `build/reports/jmh/result.json`. +By default, the benchmark test results are writen to `benchmark-tests.txt`. Use `output` input parameter to configure the output path. -E.g. the following command will run the benchmark tests for `tally-prometheus` sun-project and store -the results to `custom/path/result.json`. +E.g. the following command will run the benchmark tests for `tally-prometheus` sub-project and store +the results to `custom/path/result.txt`. ```bash -./gradlew :tally-prometheus:runJmhTests -Poutput="custom/path/result.json" +./gradlew :tally-prometheus:runJmhTests -Poutput="custom/path/result.txt" ``` diff --git a/core/build.gradle b/core/build.gradle index ba762ea..15e2c64 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -33,11 +33,11 @@ sourceSets { task runJmhTests(type: JavaExec, dependsOn: jmhClasses) { main = 'org.openjdk.jmh.Main' classpath = sourceSets.jmh.compileClasspath + sourceSets.jmh.runtimeClasspath - def resultFilePath = project.properties.get('output', 'build/reports/jmh/result.json'); + def resultFilePath = project.properties.get('output', 'benchmark-tests.txt') def resultFile = file(resultFilePath) resultFile.parentFile.mkdirs() - args '-rf', 'json' + args '-rf', 'text' args '-rff', resultFile } diff --git a/m3/README.md b/m3/README.md deleted file mode 100644 index 2d94a9d..0000000 --- a/m3/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# JMH Benchmark Tests results - -Benchmark Mode Cnt Score Error Units -M3ReporterBenchmark.reportCounterBenchmark thrpt 10 391.795 ± 38.909 ops/ms -M3ReporterBenchmark.reportGaugeBenchmark thrpt 10 439.604 ± 50.595 ops/ms -M3ReporterBenchmark.reportHistogramDurationSamplesBenchmark thrpt 10 146.534 ± 18.504 ops/ms -M3ReporterBenchmark.reportHistogramValueSamplesBenchmark thrpt 10 121.296 ± 10.906 ops/ms -M3ReporterBenchmark.reportTimerBenchmark thrpt 10 430.241 ± 46.184 ops/ms diff --git a/m3/benchmark-tests.txt b/m3/benchmark-tests.txt new file mode 100644 index 0000000..66d67ef --- /dev/null +++ b/m3/benchmark-tests.txt @@ -0,0 +1,52 @@ +Benchmark Mode Cnt Score Error Units +M3ReporterBenchmark.reportCounterBenchmark thrpt 10 392.408 ± 172.561 ops/ms +M3ReporterBenchmark.reportCounterBenchmark:·gc.alloc.rate thrpt 10 862.566 ± 422.341 MB/sec +M3ReporterBenchmark.reportCounterBenchmark:·gc.alloc.rate.norm thrpt 10 2420.767 ± 497.925 B/op +M3ReporterBenchmark.reportCounterBenchmark:·gc.churn.G1_Eden_Space thrpt 10 920.157 ± 410.566 MB/sec +M3ReporterBenchmark.reportCounterBenchmark:·gc.churn.G1_Eden_Space.norm thrpt 10 2580.137 ± 48.527 B/op +M3ReporterBenchmark.reportCounterBenchmark:·gc.churn.G1_Old_Gen thrpt 10 0.981 ± 0.668 MB/sec +M3ReporterBenchmark.reportCounterBenchmark:·gc.churn.G1_Old_Gen.norm thrpt 10 2.648 ± 0.815 B/op +M3ReporterBenchmark.reportCounterBenchmark:·gc.churn.G1_Survivor_Space thrpt 10 1.675 ± 0.539 MB/sec +M3ReporterBenchmark.reportCounterBenchmark:·gc.churn.G1_Survivor_Space.norm thrpt 10 4.823 ± 0.988 B/op +M3ReporterBenchmark.reportCounterBenchmark:·gc.count thrpt 10 321.000 counts +M3ReporterBenchmark.reportCounterBenchmark:·gc.time thrpt 10 1332.000 ms +M3ReporterBenchmark.reportGaugeBenchmark thrpt 10 506.871 ± 53.089 ops/ms +M3ReporterBenchmark.reportGaugeBenchmark:·gc.alloc.rate thrpt 10 1102.440 ± 243.462 MB/sec +M3ReporterBenchmark.reportGaugeBenchmark:·gc.alloc.rate.norm thrpt 10 2397.555 ± 495.228 B/op +M3ReporterBenchmark.reportGaugeBenchmark:·gc.churn.G1_Eden_Space thrpt 10 1177.270 ± 126.442 MB/sec +M3ReporterBenchmark.reportGaugeBenchmark:·gc.churn.G1_Eden_Space.norm thrpt 10 2558.068 ± 24.291 B/op +M3ReporterBenchmark.reportGaugeBenchmark:·gc.churn.G1_Old_Gen thrpt 10 0.994 ± 0.234 MB/sec +M3ReporterBenchmark.reportGaugeBenchmark:·gc.churn.G1_Old_Gen.norm thrpt 10 2.151 ± 0.345 B/op +M3ReporterBenchmark.reportGaugeBenchmark:·gc.churn.G1_Survivor_Space thrpt 10 2.779 ± 0.911 MB/sec +M3ReporterBenchmark.reportGaugeBenchmark:·gc.churn.G1_Survivor_Space.norm thrpt 10 6.003 ± 1.452 B/op +M3ReporterBenchmark.reportGaugeBenchmark:·gc.count thrpt 10 411.000 counts +M3ReporterBenchmark.reportGaugeBenchmark:·gc.time thrpt 10 1279.000 ms +M3ReporterBenchmark.reportHistogramDurationSamplesBenchmark thrpt 10 188.096 ± 7.091 ops/ms +M3ReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.alloc.rate thrpt 10 1367.823 ± 127.617 MB/sec +M3ReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.alloc.rate.norm thrpt 10 8010.377 ± 722.215 B/op +M3ReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.churn.G1_Eden_Space thrpt 10 1409.238 ± 58.465 MB/sec +M3ReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.churn.G1_Eden_Space.norm thrpt 10 8251.019 ± 77.856 B/op +M3ReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.churn.G1_Old_Gen thrpt 10 0.396 ± 0.061 MB/sec +M3ReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.churn.G1_Old_Gen.norm thrpt 10 2.319 ± 0.328 B/op +M3ReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.count thrpt 10 487.000 counts +M3ReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.time thrpt 10 523.000 ms +M3ReporterBenchmark.reportHistogramValueSamplesBenchmark thrpt 10 127.358 ± 27.740 ops/ms +M3ReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.alloc.rate thrpt 10 1137.984 ± 277.276 MB/sec +M3ReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.alloc.rate.norm thrpt 10 9832.138 ± 746.649 B/op +M3ReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.churn.G1_Eden_Space thrpt 10 1165.985 ± 256.119 MB/sec +M3ReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.churn.G1_Eden_Space.norm thrpt 10 10082.318 ± 226.966 B/op +M3ReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.churn.G1_Old_Gen thrpt 10 0.211 ± 0.038 MB/sec +M3ReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.churn.G1_Old_Gen.norm thrpt 10 1.846 ± 0.296 B/op +M3ReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.count thrpt 10 403.000 counts +M3ReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.time thrpt 10 542.000 ms +M3ReporterBenchmark.reportTimerBenchmark thrpt 10 512.706 ± 21.351 ops/ms +M3ReporterBenchmark.reportTimerBenchmark:·gc.alloc.rate thrpt 10 1120.503 ± 224.871 MB/sec +M3ReporterBenchmark.reportTimerBenchmark:·gc.alloc.rate.norm thrpt 10 2408.751 ± 485.159 B/op +M3ReporterBenchmark.reportTimerBenchmark:·gc.churn.G1_Eden_Space thrpt 10 1195.056 ± 53.874 MB/sec +M3ReporterBenchmark.reportTimerBenchmark:·gc.churn.G1_Eden_Space.norm thrpt 10 2567.682 ± 52.447 B/op +M3ReporterBenchmark.reportTimerBenchmark:·gc.churn.G1_Old_Gen thrpt 10 1.210 ± 0.241 MB/sec +M3ReporterBenchmark.reportTimerBenchmark:·gc.churn.G1_Old_Gen.norm thrpt 10 2.601 ± 0.543 B/op +M3ReporterBenchmark.reportTimerBenchmark:·gc.churn.G1_Survivor_Space thrpt 10 2.608 ± 0.744 MB/sec +M3ReporterBenchmark.reportTimerBenchmark:·gc.churn.G1_Survivor_Space.norm thrpt 10 5.597 ± 1.516 B/op +M3ReporterBenchmark.reportTimerBenchmark:·gc.count thrpt 10 417.000 counts +M3ReporterBenchmark.reportTimerBenchmark:·gc.time thrpt 10 1299.000 ms diff --git a/m3/build.gradle b/m3/build.gradle index 7afb822..d85cac7 100644 --- a/m3/build.gradle +++ b/m3/build.gradle @@ -41,14 +41,15 @@ sourceSets { task runJmhTests(type: JavaExec, dependsOn: jmhClasses) { main = 'org.openjdk.jmh.Main' classpath = sourceSets.jmh.compileClasspath + sourceSets.jmh.runtimeClasspath - def resultFilePath = project.properties.get('output', 'build/reports/jmh/result.json'); + def resultFilePath = project.properties.get('output', 'benchmark-tests.txt') def resultFile = file(resultFilePath) resultFile.parentFile.mkdirs() // ScopeImplBenchmark is shipped as a part of jmh source-set from :tally-core. Explicitly exclude it from running. args '-e', '.*ScopeImplBenchmark.*' - args '-rf', 'json' + args '-rf', 'text' args '-rff', resultFile + args '-prof', 'gc' } classes.finalizedBy(jmhClasses) diff --git a/prometheus/README.md b/prometheus/README.md deleted file mode 100644 index 6049622..0000000 --- a/prometheus/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# JMH Benchmark Tests Results - -Benchmark Mode Cnt Score Error Units -PrometheusReporterBenchmark.reportCounterBenchmark thrpt 10 243.828 ± 5.643 ops/ms -PrometheusReporterBenchmark.reportGaugeBenchmark thrpt 10 247.080 ± 5.012 ops/ms -PrometheusReporterBenchmark.reportHistogramDurationSamplesBenchmark thrpt 10 0.694 ± 0.114 ops/ms -PrometheusReporterBenchmark.reportHistogramValueSamplesBenchmark thrpt 10 0.731 ± 0.089 ops/ms -PrometheusReporterBenchmark.reportTimerBenchmark thrpt 10 57.263 ± 9.743 ops/ms \ No newline at end of file diff --git a/prometheus/benchmark-tests.txt b/prometheus/benchmark-tests.txt new file mode 100644 index 0000000..188e2d9 --- /dev/null +++ b/prometheus/benchmark-tests.txt @@ -0,0 +1,44 @@ +Benchmark Mode Cnt Score Error Units +PrometheusReporterBenchmark.reportCounterBenchmark thrpt 10 252.565 ± 9.554 ops/ms +PrometheusReporterBenchmark.reportCounterBenchmark:·gc.alloc.rate thrpt 10 1467.855 ± 55.338 MB/sec +PrometheusReporterBenchmark.reportCounterBenchmark:·gc.alloc.rate.norm thrpt 10 6400.005 ± 12.749 B/op +PrometheusReporterBenchmark.reportCounterBenchmark:·gc.churn.G1_Eden_Space thrpt 10 1467.271 ± 68.426 MB/sec +PrometheusReporterBenchmark.reportCounterBenchmark:·gc.churn.G1_Eden_Space.norm thrpt 10 6396.800 ± 101.919 B/op +PrometheusReporterBenchmark.reportCounterBenchmark:·gc.churn.G1_Old_Gen thrpt 10 0.008 ± 0.006 MB/sec +PrometheusReporterBenchmark.reportCounterBenchmark:·gc.churn.G1_Old_Gen.norm thrpt 10 0.034 ± 0.025 B/op +PrometheusReporterBenchmark.reportCounterBenchmark:·gc.count thrpt 10 507.000 counts +PrometheusReporterBenchmark.reportCounterBenchmark:·gc.time thrpt 10 498.000 ms +PrometheusReporterBenchmark.reportGaugeBenchmark thrpt 10 242.631 ± 25.759 ops/ms +PrometheusReporterBenchmark.reportGaugeBenchmark:·gc.alloc.rate thrpt 10 1407.404 ± 150.312 MB/sec +PrometheusReporterBenchmark.reportGaugeBenchmark:·gc.alloc.rate.norm thrpt 10 6388.006 ± 6.374 B/op +PrometheusReporterBenchmark.reportGaugeBenchmark:·gc.churn.G1_Eden_Space thrpt 10 1406.450 ± 157.275 MB/sec +PrometheusReporterBenchmark.reportGaugeBenchmark:·gc.churn.G1_Eden_Space.norm thrpt 10 6382.387 ± 92.561 B/op +PrometheusReporterBenchmark.reportGaugeBenchmark:·gc.churn.G1_Old_Gen thrpt 10 0.008 ± 0.005 MB/sec +PrometheusReporterBenchmark.reportGaugeBenchmark:·gc.churn.G1_Old_Gen.norm thrpt 10 0.036 ± 0.022 B/op +PrometheusReporterBenchmark.reportGaugeBenchmark:·gc.count thrpt 10 486.000 counts +PrometheusReporterBenchmark.reportGaugeBenchmark:·gc.time thrpt 10 468.000 ms +PrometheusReporterBenchmark.reportHistogramDurationSamplesBenchmark thrpt 10 0.693 ± 0.102 ops/ms +PrometheusReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.alloc.rate thrpt 10 4.125 ± 0.609 MB/sec +PrometheusReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.alloc.rate.norm thrpt 10 6558.180 ± 95.845 B/op +PrometheusReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.churn.G1_Eden_Space thrpt 10 5.749 ± 18.325 MB/sec +PrometheusReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.churn.G1_Eden_Space.norm thrpt 10 9188.893 ± 29287.662 B/op +PrometheusReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.count thrpt 10 2.000 counts +PrometheusReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.time thrpt 10 4.000 ms +PrometheusReporterBenchmark.reportHistogramValueSamplesBenchmark thrpt 10 0.777 ± 0.120 ops/ms +PrometheusReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.alloc.rate thrpt 10 4.355 ± 0.653 MB/sec +PrometheusReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.alloc.rate.norm thrpt 10 6177.935 ± 306.072 B/op +PrometheusReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.churn.G1_Eden_Space thrpt 10 5.749 ± 18.325 MB/sec +PrometheusReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.churn.G1_Eden_Space.norm thrpt 10 8003.890 ± 25510.799 B/op +PrometheusReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.count thrpt 10 2.000 counts +PrometheusReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.time thrpt 10 6.000 ms +PrometheusReporterBenchmark.reportTimerBenchmark thrpt 10 59.245 ± 9.588 ops/ms +PrometheusReporterBenchmark.reportTimerBenchmark:·gc.alloc.rate thrpt 10 350.727 ± 55.822 MB/sec +PrometheusReporterBenchmark.reportTimerBenchmark:·gc.alloc.rate.norm thrpt 10 6522.909 ± 254.978 B/op +PrometheusReporterBenchmark.reportTimerBenchmark:·gc.churn.G1_Eden_Space thrpt 10 350.339 ± 60.449 MB/sec +PrometheusReporterBenchmark.reportTimerBenchmark:·gc.churn.G1_Eden_Space.norm thrpt 10 6511.451 ± 386.151 B/op +PrometheusReporterBenchmark.reportTimerBenchmark:·gc.churn.G1_Old_Gen thrpt 10 0.187 ± 0.176 MB/sec +PrometheusReporterBenchmark.reportTimerBenchmark:·gc.churn.G1_Old_Gen.norm thrpt 10 3.343 ± 2.807 B/op +PrometheusReporterBenchmark.reportTimerBenchmark:·gc.churn.G1_Survivor_Space thrpt 10 0.228 ± 0.425 MB/sec +PrometheusReporterBenchmark.reportTimerBenchmark:·gc.churn.G1_Survivor_Space.norm thrpt 10 3.932 ± 7.173 B/op +PrometheusReporterBenchmark.reportTimerBenchmark:·gc.count thrpt 10 122.000 counts +PrometheusReporterBenchmark.reportTimerBenchmark:·gc.time thrpt 10 369.000 ms diff --git a/prometheus/build.gradle b/prometheus/build.gradle index ffeee8a..a8f0343 100644 --- a/prometheus/build.gradle +++ b/prometheus/build.gradle @@ -37,14 +37,15 @@ sourceSets { task runJmhTests(type: JavaExec, dependsOn: jmhClasses) { main = 'org.openjdk.jmh.Main' classpath = sourceSets.jmh.compileClasspath + sourceSets.jmh.runtimeClasspath - def resultFilePath = project.properties.get('output', 'build/reports/jmh/result.json'); + def resultFilePath = project.properties.get('output', 'benchmark-tests.txt') def resultFile = file(resultFilePath) resultFile.parentFile.mkdirs() // ScopeImplBenchmark is shipped as a part of jmh source-set from :tally-core. Explicitly exclude it from running. args '-e', '.*ScopeImplBenchmark.*' - args '-rf', 'json' + args '-rf', 'text' args '-rff', resultFile + args '-prof', 'gc' } classes.finalizedBy(jmhClasses) diff --git a/statsd/README.md b/statsd/README.md deleted file mode 100644 index 669951d..0000000 --- a/statsd/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# JMH Benchmark Tests results - -Benchmark Mode Cnt Score Error Units -StatsdReporterBenchmark.reportCounterBenchmark thrpt 10 411.498 ± 69.192 ops/ms -StatsdReporterBenchmark.reportGaugeBenchmark thrpt 10 273.496 ± 47.997 ops/ms -StatsdReporterBenchmark.reportHistogramDurationSamplesBenchmark thrpt 10 137.606 ± 53.928 ops/ms -StatsdReporterBenchmark.reportHistogramValueSamplesBenchmark thrpt 10 91.010 ± 25.876 ops/ms -StatsdReporterBenchmark.reportTimerBenchmark thrpt 10 402.208 ± 206.062 ops/ms \ No newline at end of file diff --git a/statsd/benchmark-tests.txt b/statsd/benchmark-tests.txt new file mode 100644 index 0000000..f31258a --- /dev/null +++ b/statsd/benchmark-tests.txt @@ -0,0 +1,46 @@ +Benchmark Mode Cnt Score Error Units +StatsdReporterBenchmark.reportCounterBenchmark thrpt 10 549.550 ± 62.916 ops/ms +StatsdReporterBenchmark.reportCounterBenchmark:·gc.alloc.rate thrpt 10 1263.308 ± 232.626 MB/sec +StatsdReporterBenchmark.reportCounterBenchmark:·gc.alloc.rate.norm thrpt 10 2568.898 ± 188.826 B/op +StatsdReporterBenchmark.reportCounterBenchmark:·gc.churn.G1_Eden_Space thrpt 10 1291.770 ± 171.529 MB/sec +StatsdReporterBenchmark.reportCounterBenchmark:·gc.churn.G1_Eden_Space.norm thrpt 10 2633.801 ± 37.553 B/op +StatsdReporterBenchmark.reportCounterBenchmark:·gc.churn.G1_Old_Gen thrpt 10 0.005 ± 0.002 MB/sec +StatsdReporterBenchmark.reportCounterBenchmark:·gc.churn.G1_Old_Gen.norm thrpt 10 0.010 ± 0.002 B/op +StatsdReporterBenchmark.reportCounterBenchmark:·gc.count thrpt 10 454.000 counts +StatsdReporterBenchmark.reportCounterBenchmark:·gc.time thrpt 10 373.000 ms +StatsdReporterBenchmark.reportGaugeBenchmark thrpt 10 531.119 ± 39.766 ops/ms +StatsdReporterBenchmark.reportGaugeBenchmark:·gc.alloc.rate thrpt 10 1219.281 ± 179.957 MB/sec +StatsdReporterBenchmark.reportGaugeBenchmark:·gc.alloc.rate.norm thrpt 10 2568.862 ± 191.394 B/op +StatsdReporterBenchmark.reportGaugeBenchmark:·gc.churn.G1_Eden_Space thrpt 10 1247.889 ± 128.563 MB/sec +StatsdReporterBenchmark.reportGaugeBenchmark:·gc.churn.G1_Eden_Space.norm thrpt 10 2632.824 ± 57.977 B/op +StatsdReporterBenchmark.reportGaugeBenchmark:·gc.churn.G1_Old_Gen thrpt 10 0.005 ± 0.001 MB/sec +StatsdReporterBenchmark.reportGaugeBenchmark:·gc.churn.G1_Old_Gen.norm thrpt 10 0.010 ± 0.003 B/op +StatsdReporterBenchmark.reportGaugeBenchmark:·gc.count thrpt 10 439.000 counts +StatsdReporterBenchmark.reportGaugeBenchmark:·gc.time thrpt 10 379.000 ms +StatsdReporterBenchmark.reportHistogramDurationSamplesBenchmark thrpt 10 302.625 ± 63.109 ops/ms +StatsdReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.alloc.rate thrpt 10 1183.288 ± 306.446 MB/sec +StatsdReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.alloc.rate.norm thrpt 10 4363.289 ± 252.996 B/op +StatsdReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.churn.G1_Eden_Space thrpt 10 1201.555 ± 284.875 MB/sec +StatsdReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.churn.G1_Eden_Space.norm thrpt 10 4439.922 ± 112.765 B/op +StatsdReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.churn.G1_Old_Gen thrpt 10 0.006 ± 0.002 MB/sec +StatsdReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.churn.G1_Old_Gen.norm thrpt 10 0.021 ± 0.006 B/op +StatsdReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.count thrpt 10 422.000 counts +StatsdReporterBenchmark.reportHistogramDurationSamplesBenchmark:·gc.time thrpt 10 379.000 ms +StatsdReporterBenchmark.reportHistogramValueSamplesBenchmark thrpt 10 222.617 ± 16.067 ops/ms +StatsdReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.alloc.rate thrpt 10 1182.677 ± 126.802 MB/sec +StatsdReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.alloc.rate.norm thrpt 10 5954.897 ± 360.144 B/op +StatsdReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.churn.G1_Eden_Space thrpt 10 1202.325 ± 80.960 MB/sec +StatsdReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.churn.G1_Eden_Space.norm thrpt 10 6060.839 ± 274.812 B/op +StatsdReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.churn.G1_Old_Gen thrpt 10 0.006 ± 0.002 MB/sec +StatsdReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.churn.G1_Old_Gen.norm thrpt 10 0.030 ± 0.012 B/op +StatsdReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.count thrpt 10 423.000 counts +StatsdReporterBenchmark.reportHistogramValueSamplesBenchmark:·gc.time thrpt 10 368.000 ms +StatsdReporterBenchmark.reportTimerBenchmark thrpt 10 475.146 ± 70.444 ops/ms +StatsdReporterBenchmark.reportTimerBenchmark:·gc.alloc.rate thrpt 10 1109.899 ± 177.935 MB/sec +StatsdReporterBenchmark.reportTimerBenchmark:·gc.alloc.rate.norm thrpt 10 2621.710 ± 199.062 B/op +StatsdReporterBenchmark.reportTimerBenchmark:·gc.churn.G1_Eden_Space thrpt 10 1138.733 ± 162.365 MB/sec +StatsdReporterBenchmark.reportTimerBenchmark:·gc.churn.G1_Eden_Space.norm thrpt 10 2689.402 ± 39.785 B/op +StatsdReporterBenchmark.reportTimerBenchmark:·gc.churn.G1_Old_Gen thrpt 10 0.005 ± 0.002 MB/sec +StatsdReporterBenchmark.reportTimerBenchmark:·gc.churn.G1_Old_Gen.norm thrpt 10 0.011 ± 0.004 B/op +StatsdReporterBenchmark.reportTimerBenchmark:·gc.count thrpt 10 401.000 counts +StatsdReporterBenchmark.reportTimerBenchmark:·gc.time thrpt 10 393.000 ms diff --git a/statsd/build.gradle b/statsd/build.gradle index c3b1bcb..c445989 100644 --- a/statsd/build.gradle +++ b/statsd/build.gradle @@ -37,14 +37,15 @@ sourceSets { task runJmhTests(type: JavaExec, dependsOn: jmhClasses) { main = 'org.openjdk.jmh.Main' classpath = sourceSets.jmh.compileClasspath + sourceSets.jmh.runtimeClasspath - def resultFilePath = project.properties.get('output', 'build/reports/jmh/result.json'); + def resultFilePath = project.properties.get('output', 'benchmark-tests.txt') def resultFile = file(resultFilePath) resultFile.parentFile.mkdirs() // ScopeImplBenchmark is shipped as a part of jmh source-set from :tally-core. Explicitly exclude it from running. args '-e', '.*ScopeImplBenchmark.*' - args '-rf', 'json' + args '-rf', 'text' args '-rff', resultFile + args '-prof', 'gc' } classes.finalizedBy(jmhClasses) From fa06099862884c653e9ec1041b3a7cec0e9cdaa6 Mon Sep 17 00:00:00 2001 From: Andrei Sokol Date: Tue, 2 Mar 2021 21:56:22 +0100 Subject: [PATCH 10/10] Merge master --- .../prometheus/PrometheusReporterBenchmark.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename prometheus/src/jmh/java/com/uber/m3/tally/{ => experimental}/prometheus/PrometheusReporterBenchmark.java (96%) diff --git a/prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java b/prometheus/src/jmh/java/com/uber/m3/tally/experimental/prometheus/PrometheusReporterBenchmark.java similarity index 96% rename from prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java rename to prometheus/src/jmh/java/com/uber/m3/tally/experimental/prometheus/PrometheusReporterBenchmark.java index fd60596..c9948a0 100644 --- a/prometheus/src/jmh/java/com/uber/m3/tally/prometheus/PrometheusReporterBenchmark.java +++ b/prometheus/src/jmh/java/com/uber/m3/tally/experimental/prometheus/PrometheusReporterBenchmark.java @@ -18,7 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.uber.m3.tally.prometheus; +package com.uber.m3.tally.experimental.prometheus; import com.uber.m3.tally.AbstractReporterBenchmark; import com.uber.m3.tally.StatsReporter;