Skip to content

Commit

Permalink
Merge pull request #3476 from DataDog/bm-log_correlation
Browse files Browse the repository at this point in the history
  • Loading branch information
marcotc authored Feb 23, 2024
2 parents d25ae75 + 181eba4 commit d24fd06
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions benchmarks/tracing_trace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,22 @@ def benchmark_to_digest
end
end
end

def benchmark_log_correlation
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("Tracing.log_correlation") do
Datadog::Tracing.log_correlation
end

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

puts "Current pid is #{Process.pid}"
Expand All @@ -98,4 +114,5 @@ def run_benchmark(&block)
run_benchmark { benchmark_no_writer }
run_benchmark { benchmark_no_network }
run_benchmark { benchmark_to_digest }
run_benchmark { benchmark_log_correlation }
end

0 comments on commit d24fd06

Please sign in to comment.