Makes the new queueInstrumentation opt-in
This commit is contained in:
@@ -33,8 +33,8 @@ public class Pair {
|
||||
return new Pair(key, value);
|
||||
}
|
||||
|
||||
public static Pair noHook() {
|
||||
return new Pair("spring.sleuth.reactor.decorate-queues", "false");
|
||||
public static Pair onHook() {
|
||||
return new Pair("spring.sleuth.reactor.decorate-queues", "true");
|
||||
}
|
||||
|
||||
public static Pair noSleuth() {
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import brave.Tracer;
|
||||
import brave.Tracing;
|
||||
import jmh.mbr.junit5.Microbenchmark;
|
||||
import org.junit.platform.commons.annotation.Testable;
|
||||
@@ -134,6 +135,7 @@ public class MicroBenchmarkStreamTests {
|
||||
} else {
|
||||
assertThat(b3).startsWith("4883117762eb9420");
|
||||
}
|
||||
assertThat(this.applicationContext.getBean(Tracer.class).currentSpan()).isNull();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,15 +157,15 @@ public class MicroBenchmarkStreamTests {
|
||||
|
||||
// @formatter:off
|
||||
noSleuthSimple(Pair.noSleuth(), function("simple")),
|
||||
sleuthSimpleOnHooks(function("simple")),
|
||||
sleuthSimpleOnEach(function("simple"), Pair.noHook(), Pair.onEach()),
|
||||
sleuthSimpleOnLast(function("simple"), Pair.noHook(), Pair.onLast()),
|
||||
sleuthSimpleWithAroundOnHooks(function("simple_function_with_around")),
|
||||
sleuthSimpleWithAroundOnEach(function("simple_function_with_around"), Pair.noHook(), Pair.onEach()),
|
||||
sleuthSimpleWithAroundOnLast(function("simple_function_with_around"), Pair.noHook(), Pair.onLast()),
|
||||
sleuthSimpleOnHooks(function("simple"), Pair.onHook()),
|
||||
sleuthSimpleOnEach(function("simple"), Pair.onEach()),
|
||||
sleuthSimpleOnLast(function("simple"), Pair.onLast()),
|
||||
sleuthSimpleWithAroundOnHooks(function("simple_function_with_around"), Pair.onHook()),
|
||||
sleuthSimpleWithAroundOnEach(function("simple_function_with_around"), Pair.onEach()),
|
||||
sleuthSimpleWithAroundOnLast(function("simple_function_with_around"), Pair.onLast()),
|
||||
noSleuthReactiveSimple(function("reactive_simple"), Pair.noSleuth()),
|
||||
sleuthReactiveSimpleOnHooks(function("DECORATE_ON_EACH")),
|
||||
sleuthReactiveSimpleOnEach(function("DECORATE_ON_EACH"), Pair.noHook(), Pair.onEach(), integrationEnabled());
|
||||
sleuthReactiveSimpleOnHooks(function("DECORATE_ON_EACH"), Pair.onHook()),
|
||||
sleuthReactiveSimpleOnEach(function("DECORATE_ON_EACH"), Pair.onEach(), integrationEnabled());
|
||||
// @formatter:on
|
||||
|
||||
private List<Pair> pairs;
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import brave.Tracer;
|
||||
import brave.Tracing;
|
||||
import jmh.mbr.junit5.Microbenchmark;
|
||||
import org.junit.platform.commons.annotation.Testable;
|
||||
@@ -47,6 +48,8 @@ import org.springframework.cloud.sleuth.benchmarks.jmh.TracerImplementation;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.test.web.reactive.server.WebTestClient;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@Measurement(iterations = 10, time = 1)
|
||||
@Warmup(iterations = 10, time = 1)
|
||||
@Fork(4)
|
||||
@@ -98,6 +101,7 @@ public class MicroBenchmarkHttpTests {
|
||||
void run() {
|
||||
this.webTestClient.get().uri(instrumentation.url).header("X-B3-TraceId", "4883117762eb9420")
|
||||
.header("X-B3-SpanId", "4883117762eb9420").exchange().expectStatus().isOk();
|
||||
assertThat(this.applicationContext.getBean(Tracer.class).currentSpan()).isNull();
|
||||
}
|
||||
|
||||
@TearDown
|
||||
@@ -118,13 +122,13 @@ public class MicroBenchmarkHttpTests {
|
||||
|
||||
// @formatter:off
|
||||
noSleuthSimple("/simple", Pair.noSleuth()),
|
||||
sleuthSimpleOnHooks("/simple"),
|
||||
sleuthSimpleOnEach("/simple", Pair.noHook(), Pair.onEach()),
|
||||
sleuthSimpleOnLast("/simple", Pair.noHook(), Pair.onLast()),
|
||||
sleuthSimpleOnHooks("/simple", Pair.onHook()),
|
||||
sleuthSimpleOnEach("/simple", Pair.onEach()),
|
||||
sleuthSimpleOnLast("/simple", Pair.onLast()),
|
||||
noSleuthComplex("/complexNoSleuth", Pair.noSleuth()),
|
||||
onHooksComplex("/complex"),
|
||||
onEachComplex("/complex", Pair.noHook(), Pair.onEach()),
|
||||
onLastComplex("/complex", Pair.noHook(), Pair.onLast());
|
||||
onHooksComplex("/complex", Pair.onHook()),
|
||||
onEachComplex("/complex", Pair.onEach()),
|
||||
onLastComplex("/complex", Pair.onLast());
|
||||
// @formatter:on
|
||||
|
||||
private String url;
|
||||
|
||||
Reference in New Issue
Block a user