From 1e2f04e765696aeff8b0d9eb62726a74daeac251 Mon Sep 17 00:00:00 2001 From: Mitch Hartweg Date: Tue, 7 Jan 2025 09:38:59 -0500 Subject: [PATCH] get rate for sample uri --- lib/scout_apm/sampling.rb | 5 ++--- test/unit/sampling_test.rb | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/scout_apm/sampling.rb b/lib/scout_apm/sampling.rb index e4a109e2..869e9a41 100644 --- a/lib/scout_apm/sampling.rb +++ b/lib/scout_apm/sampling.rb @@ -38,7 +38,7 @@ def ignore?(transaction) uri = transaction.annotations[:uri] return true if ignore_uri?(uri) if sample_uri?(uri) - return true if sample?(uri) + return true if sample?(sample_endpoints[uri]) end end @@ -51,8 +51,7 @@ def individual_sample_to_hash(sampling_config) sample_hash = {} sampling_config.each do |sample| path, rate = sample.split(':') - rate = rate.to_i - sample_hash[path] = rate + sample_hash[path] = rate.to_i end sample_hash end diff --git a/test/unit/sampling_test.rb b/test/unit/sampling_test.rb index f6aedb32..5b32ebb4 100644 --- a/test/unit/sampling_test.rb +++ b/test/unit/sampling_test.rb @@ -3,7 +3,6 @@ require 'scout_apm/sampling' class SamplingTest < Minitest::Test - # tr = ScoutApm::TrackedRequest.new(ScoutApm::AgentContext.new, ScoutApm::FakeStore.new) def setup @global_sample_config = FakeConfigOverlay.new(