org.openjdk.jmh.annotations.Scope Java Examples
The following examples show how to use
org.openjdk.jmh.annotations.Scope.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GraphState.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
@SuppressWarnings("try") public GraphState() { // Ensure a debug configuration for this thread is initialized if (Debug.isEnabled() && DebugScope.getConfig() == null) { DebugEnvironment.initialize(System.out); } GraalState graal = new GraalState(); ResolvedJavaMethod method = graal.metaAccess.lookupJavaMethod(getMethodFromMethodSpec(getClass())); StructuredGraph structuredGraph = null; try (Debug.Scope s = Debug.scope("GraphState", method)) { structuredGraph = preprocessOriginal(getGraph(graal, method)); } catch (Throwable t) { Debug.handle(t); } this.originalGraph = structuredGraph; }
Example #2
Source File: DefaultTracerBenchmarks.java From opentelemetry-java with Apache License 2.0 | 5 votes |
/** Benchmark the full span lifecycle. */ @Benchmark @BenchmarkMode({Mode.AverageTime}) @Fork(1) @Measurement(iterations = 15, time = 1) @OutputTimeUnit(TimeUnit.NANOSECONDS) @Warmup(iterations = 5, time = 1) public void measureFullSpanLifecycle() { span = tracer.spanBuilder("span").startSpan(); try (io.opentelemetry.context.Scope ignored = tracer.withSpan(span)) { // no-op } finally { span.end(); } }
Example #3
Source File: DefaultTracerBenchmarks.java From opentelemetry-java with Apache License 2.0 | 5 votes |
/** Benchmark just the scope lifecycle. */ @Benchmark @BenchmarkMode({Mode.AverageTime}) @Fork(1) @Measurement(iterations = 15, time = 1) @OutputTimeUnit(TimeUnit.NANOSECONDS) @Warmup(iterations = 5, time = 1) public void measureScopeLifecycle() { try (io.opentelemetry.context.Scope ignored = tracer.withSpan(span)) { // no-op } }
Example #4
Source File: GraalCompilerState.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
@SuppressWarnings("try") protected void initializeMethod() { GraalState graal = new GraalState(); ResolvedJavaMethod method = graal.metaAccess.lookupJavaMethod(getMethod()); StructuredGraph structuredGraph = null; try (Debug.Scope s = Debug.scope("GraphState", method)) { structuredGraph = preprocessOriginal(getGraph(graal, method, useProfilingInfo())); } catch (Throwable t) { Debug.handle(t); } this.originalGraph = structuredGraph; }
Example #5
Source File: SpringWebFluxBenchmarks.java From spring-cloud-sleuth with Apache License 2.0 | 5 votes |
@Benchmark public void tracedClient_get_resumeTrace() throws Exception { try (CurrentTraceContext.Scope scope = Tracing.current().currentTraceContext() .newScope(defaultTraceContext)) { get(tracedClient); } }
Example #6
Source File: TracerBenchmarks.java From brave with Apache License 2.0 | 4 votes |
void currentSpan(Tracer tracer, TraceContext context, boolean tag) { try (CurrentTraceContext.Scope scope = tracer.currentTraceContext.newScope(context)) { Span span = tracer.currentSpan(); if (tag) span.tag("customer.id", "1234"); } }