@Nullable static TraceContext currentTraceContext() { Tracing tracing = Tracing.current(); return tracing != null ? tracing.currentTraceContext().get() : null; }
/** * This closes the current instance of tracing, to prevent it from being accidentally visible to * other test classes which call {@link Tracing#current()}. */ @After public void close() throws Exception { Tracing current = Tracing.current(); if (current != null) current.close(); }
@Benchmark public void tracedClient_get_resumeTrace() throws Exception { try (Scope scope = Tracing.current().currentTraceContext().newScope(context)) { get(tracedClient); } } }
@Nullable static TraceContext currentTraceContext() { Tracing tracing = Tracing.current(); return tracing != null ? tracing.currentTraceContext().get() : null; }
@TearDown(Level.Trial) public void close() { Tracing.current().close(); }
/** Returns the current {@link #traceId(TraceContext)} or null if not available */ @Nullable public static String currentTraceId() { Tracing tracing = Tracing.current(); if (tracing == null) return null; TraceContext context = tracing.currentTraceContext().get(); if (context == null) return null; return traceId(context); }
@TearDown(Level.Trial) public void close() { Tracing.current().close(); }
@TearDown(Level.Trial) public void close() { Tracing.current().close(); }
@TearDown(Level.Trial) public void close() { Tracing.current().close(); }
@After public void tearDown() { Tracing.current().close(); }
@After public void tearDown() { Tracing.current().close(); }
@After public void tearDown() { Tracing.current().close(); }
@TearDown(Level.Trial) public void close() throws Exception { close(client); close(unsampledClient); close(tracedClient); server.stop(); Tracing.current().close(); }
/** * This closes the current instance of tracing, to prevent it from being accidentally visible to * other test classes which call {@link Tracing#current()}. */ @After public void close() throws Exception { Tracing current = Tracing.current(); if (current != null) current.close(); }