From 1e9509080ceb64cbab6f1b6f937d43a3cabc3456 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Wed, 25 Sep 2024 13:18:23 +0200 Subject: [PATCH] Remove obsolete test that never ran --- .../contrib/active_record/performance_spec.rb | 59 ------------------- .../tracing/transport/http/benchmark_spec.rb | 50 ---------------- 2 files changed, 109 deletions(-) delete mode 100644 spec/datadog/tracing/contrib/active_record/performance_spec.rb delete mode 100644 spec/datadog/tracing/transport/http/benchmark_spec.rb diff --git a/spec/datadog/tracing/contrib/active_record/performance_spec.rb b/spec/datadog/tracing/contrib/active_record/performance_spec.rb deleted file mode 100644 index efdffe43937..00000000000 --- a/spec/datadog/tracing/contrib/active_record/performance_spec.rb +++ /dev/null @@ -1,59 +0,0 @@ -require 'datadog/tracing/contrib/support/spec_helper' -require 'datadog' - -require 'active_record' - -if PlatformHelpers.jruby? - require 'activerecord-jdbc-adapter' -else - require 'sqlite3' -end - -RSpec.describe 'ActiveRecord tracing performance' do - let(:options) { {} } - - before do - skip('Performance test does not run in CI.') - - # Configure the tracer - Datadog.configure do |c| - c.tracing.instrument :active_record, options - end - end - - after { Datadog.registry[:active_record].reset_configuration! } - - describe 'for an in-memory database' do - let!(:connection) do - ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') - end - - describe 'when queried with a simple select' do - subject(:measurement) { measure(iterations) } - - let(:iterations) { 100_000 } - - def measure(iterations = 1) - Benchmark.measure do - iterations.times do - connection.connection.execute('SELECT 42') - end - end - end - - before do - # Perform a measurement to warm up - measure(10) - - # Discard warm-up spans - clear_traces! - end - - it 'produces a measurement' do - expect { measurement }.to_not raise_error - expect(spans).to have(iterations).items - puts "\nRun time for #{iterations} iterations: #{measurement.utime}\n" - end - end - end -end diff --git a/spec/datadog/tracing/transport/http/benchmark_spec.rb b/spec/datadog/tracing/transport/http/benchmark_spec.rb deleted file mode 100644 index ef1258ef7f3..00000000000 --- a/spec/datadog/tracing/transport/http/benchmark_spec.rb +++ /dev/null @@ -1,50 +0,0 @@ -require 'spec_helper' - -require 'benchmark' -require 'datadog' -require 'datadog/tracing/transport/http' - -RSpec.describe 'Transport::HTTP benchmarks' do - let(:iterations) { 100 } - - before { skip('Performance test does not run in CI.') } - - describe '#send' do - let!(:default_transport) { Datadog::Tracing::Transport::HTTP.default } - let!(:net_transport) { Datadog::Tracing::Transport::HTTP.default { |t| t.adapter :net_http } } - let!(:unix_transport) { Datadog::Tracing::Transport::HTTP.default { |t| t.adapter :unix } } - let!(:test_transport) { Datadog::Tracing::Transport::HTTP.default { |t| t.adapter :test } } - - let!(:traces) { get_test_traces(2) } - - it do - Benchmark.bm do |x| - x.report('Default Datadog::Tracing::Transport::HTTP') do - iterations.times do - default_transport.send_traces(traces) - end - end - - x.report('Datadog::Tracing::Transport::HTTP with Net::HTTP adapter') do - iterations.times do - net_transport.send_traces(traces) - end - end - - # TODO: Enable me when Unix socket support for Datadog agent is released in 6.13. - # Then update the agent configuration for the test suite to enable Unix sockets. - # x.report('Datadog::Tracing::Transport::HTTP with Unix socket adapter') do - # iterations.times do - # unix_transport.send_traces(traces) - # end - # end - - x.report('Datadog::Tracing::Transport::HTTP with test adapter') do - iterations.times do - test_transport.send_traces(traces) - end - end - end - end - end -end