Skip to content

Commit

Permalink
get rate for sample uri
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitch Hartweg committed Jan 7, 2025
1 parent 93c5e27 commit 1e2f04e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/scout_apm/sampling.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion test/unit/sampling_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 1e2f04e

Please sign in to comment.