Skip to content

Commit 1e13d53

Browse files
bm1549claude
andcommitted
Fix activeSpanLookup benchmark to exercise live scope stack
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 94cfb4f commit 1e13d53

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

dd-trace-core/src/jmh/java/datadog/trace/core/ScopeLifecycleBenchmark.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,18 @@ public class ScopeLifecycleBenchmark {
3232
public static class ThreadState {
3333
AgentSpan span;
3434
AgentSpan childSpan;
35+
AgentScope activeScope;
3536

3637
@Setup(Level.Iteration)
3738
public void setup() {
3839
span = TRACER.startSpan("benchmark", "parent");
3940
childSpan = TRACER.startSpan("benchmark", "child");
41+
activeScope = TRACER.activateSpan(span);
4042
}
4143

4244
@TearDown(Level.Iteration)
4345
public void tearDown() {
46+
activeScope.close();
4447
childSpan.finish();
4548
span.finish();
4649
}

0 commit comments

Comments
 (0)