Skip to content

Commit

Permalink
Add benchmark for continue digest
Browse files Browse the repository at this point in the history
  • Loading branch information
marcotc committed Feb 23, 2024
1 parent 85cee5e commit d3b67fc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions benchmarks/tracing_trace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,23 @@ def benchmark_log_correlation
end
end

def benchmark_to_digest_continue
Datadog::Tracing.trace('op.name') do |span, trace|
Benchmark.ips do |x|
benchmark_time = VALIDATE_BENCHMARK_MODE ? { time: 0.001, warmup: 0 } : { time: 10.5, warmup: 2 }
x.config(**benchmark_time)

x.report("trace.to_digest - Continue") do
digest = trace.to_digest
Datadog::Tracing.continue_trace!(digest)
end

x.save! "#{__FILE__}-results.json" unless VALIDATE_BENCHMARK_MODE
x.compare!
end
end
end

def benchmark_propagation_datadog
Datadog.configure do |c|
c.tracing.propagation_style = ['datadog']
Expand Down Expand Up @@ -163,6 +180,7 @@ def run_benchmark(&block)
run_benchmark { benchmark_no_network }
run_benchmark { benchmark_to_digest }
run_benchmark { benchmark_log_correlation }
run_benchmark { benchmark_to_digest_continue }
run_benchmark { benchmark_propagation_datadog }
run_benchmark { benchmark_propagation_trace_context }
end

0 comments on commit d3b67fc

Please sign in to comment.