Skip to content

Commit

Permalink
prefix benchmark names with the product as per their source file
Browse files Browse the repository at this point in the history
  • Loading branch information
p committed Aug 6, 2024
1 parent 0ba87b9 commit 52967e5
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 23 deletions.
15 changes: 15 additions & 0 deletions benchmarks/benchmarks_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require 'benchmark/ips'
require 'datadog'
require 'pry'

module JobReporter
def report(name, *args, **opts, &block)
caller_path = caller_locations.first.path
prefix = File.basename(caller_path).sub(/_.*\z/, '')
super("#{prefix} - #{name}", *args, **opts, &block)
end
end

class Benchmark::IPS::Job
prepend JobReporter
end
1 change: 1 addition & 0 deletions benchmarks/library_gem_loading.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

return unless __FILE__ == $PROGRAM_NAME || VALIDATE_BENCHMARK_MODE

require_relative 'benchmarks_helper'
require 'open3'

class GemLoadingBenchmark
Expand Down
4 changes: 1 addition & 3 deletions benchmarks/profiler_allocation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

return unless __FILE__ == $PROGRAM_NAME || VALIDATE_BENCHMARK_MODE

require 'benchmark/ips'
require 'datadog'
require 'pry'
require_relative 'benchmarks_helper'

# This benchmark measures the performance of allocation profiling

Expand Down
4 changes: 1 addition & 3 deletions benchmarks/profiler_gc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

return unless __FILE__ == $PROGRAM_NAME || VALIDATE_BENCHMARK_MODE

require 'benchmark/ips'
require 'datadog'
require 'pry'
require_relative 'benchmarks_helper'

# This benchmark measures the performance of GC profiling

Expand Down
4 changes: 1 addition & 3 deletions benchmarks/profiler_hold_resume_interruptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

return unless __FILE__ == $PROGRAM_NAME || VALIDATE_BENCHMARK_MODE

require 'benchmark/ips'
require 'datadog'
require 'pry'
require_relative 'benchmarks_helper'

# This benchmark measures the performance of the hold/resume interruptions used by the DirMonkeyPatches
class ProfilerHoldResumeInterruptions
Expand Down
4 changes: 1 addition & 3 deletions benchmarks/profiler_http_transport.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

return unless __FILE__ == $PROGRAM_NAME || VALIDATE_BENCHMARK_MODE

require 'benchmark/ips'
require 'datadog'
require 'pry'
require_relative 'benchmarks_helper'
require 'securerandom'
require 'socket'

Expand Down
4 changes: 1 addition & 3 deletions benchmarks/profiler_memory_sample_serialize.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

return unless __FILE__ == $PROGRAM_NAME || VALIDATE_BENCHMARK_MODE

require 'benchmark/ips'
require 'datadog'
require 'pry'
require_relative 'benchmarks_helper'

require 'libdatadog'

Expand Down
4 changes: 1 addition & 3 deletions benchmarks/profiler_sample_loop_v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

return unless __FILE__ == $PROGRAM_NAME || VALIDATE_BENCHMARK_MODE

require 'benchmark/ips'
require 'datadog'
require 'pry'
require_relative 'benchmarks_helper'

# This benchmark measures the performance of the main stack sampling loop of the profiler

Expand Down
4 changes: 1 addition & 3 deletions benchmarks/profiler_sample_serialize.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

return unless __FILE__ == $PROGRAM_NAME || VALIDATE_BENCHMARK_MODE

require 'benchmark/ips'
require 'datadog'
require 'pry'
require_relative 'benchmarks_helper'

require 'libdatadog'

Expand Down
3 changes: 1 addition & 2 deletions benchmarks/tracing_trace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

return unless __FILE__ == $PROGRAM_NAME || VALIDATE_BENCHMARK_MODE

require 'benchmark/ips'
require 'datadog'
require_relative 'benchmarks_helper'

class TracingTraceBenchmark
module NoopWriter
Expand Down

0 comments on commit 52967e5

Please sign in to comment.