Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
Disabled publishing in the CompareOTLPHistograms benchmark, which may have contributed to variability in results.
  • Loading branch information
shakuzen committed Dec 25, 2024
1 parent d77b7be commit b2d8277
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,26 @@
*/
@Fork(1)
@Measurement(iterations = 2)
@Warmup(iterations = 2)
@BenchmarkMode(Mode.AverageTime)
@Warmup(iterations = 3)
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@Threads(16)
@Threads(2)
public class CompareOTLPHistograms {

// disable publishing since we are only benchmarking recording
static OtlpConfig disabledConfig = new OtlpConfig() {

@Override
public boolean enabled() {
return false;
}

@Override
public String get(String key) {
return "";
}
};

@State(Scope.Thread)
public static class Data {

Expand Down Expand Up @@ -82,7 +96,7 @@ public static class DistributionsWithoutHistogramCumulative {

@Setup(Level.Iteration)
public void setup() {
registry = new OtlpMeterRegistry();
registry = new OtlpMeterRegistry(disabledConfig, Clock.SYSTEM);
distributionSummary = DistributionSummary.builder("ds").register(registry);
timer = Timer.builder("timer").register(registry);
}
Expand All @@ -99,6 +113,11 @@ public static class DistributionsWithoutHistogramDelta {

OtlpConfig otlpConfig = new OtlpConfig() {

@Override
public boolean enabled() {
return false;
}

@Override
public AggregationTemporality aggregationTemporality() {
return AggregationTemporality.DELTA;
Expand Down Expand Up @@ -142,7 +161,7 @@ public static class ExplicitBucketHistogramCumulative {

@Setup(Level.Iteration)
public void setup() {
registry = new OtlpMeterRegistry();
registry = new OtlpMeterRegistry(disabledConfig, Clock.SYSTEM);
distributionSummary = DistributionSummary.builder("ds").publishPercentileHistogram().register(registry);
timer = Timer.builder("timer").publishPercentileHistogram().register(registry);
}
Expand All @@ -159,6 +178,11 @@ public static class ExplicitBucketHistogramDelta {

OtlpConfig otlpConfig = new OtlpConfig() {

@Override
public boolean enabled() {
return false;
}

@Override
public AggregationTemporality aggregationTemporality() {
return AggregationTemporality.DELTA;
Expand Down Expand Up @@ -197,6 +221,12 @@ public static class ExponentialHistogramCumulative {
MeterRegistry registry;

OtlpConfig otlpConfig = new OtlpConfig() {

@Override
public boolean enabled() {
return false;
}

@Override
public HistogramFlavor histogramFlavor() {
return HistogramFlavor.BASE2_EXPONENTIAL_BUCKET_HISTOGRAM;
Expand Down Expand Up @@ -234,6 +264,11 @@ public static class ExponentialHistogramDelta {

OtlpConfig otlpConfig = new OtlpConfig() {

@Override
public boolean enabled() {
return false;
}

@Override
public AggregationTemporality aggregationTemporality() {
return AggregationTemporality.DELTA;
Expand Down
3 changes: 2 additions & 1 deletion concurrency-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ dependencies {
implementation project(":micrometer-core")
// implementation("io.micrometer:micrometer-core:1.14.1")
implementation project(":micrometer-registry-prometheus")
implementation project(":micrometer-registry-otlp")
// implementation("io.micrometer:micrometer-registry-prometheus:1.14.1")
implementation project(":micrometer-registry-otlp")

runtimeOnly(libs.logbackLatest)
}

Expand Down

0 comments on commit b2d8277

Please sign in to comment.