Class: Sqreen::Ecosystem::Tracing::Sampler
- Inherits:
-
Object
- Object
- Sqreen::Ecosystem::Tracing::Sampler
- Defined in:
- lib/sqreen/ecosystem/tracing/sampler.rb
Defined Under Namespace
Classes: AlwaysFalsePrimitive, CallsPrimitive, Line, MaxCallsPrimitive, MaxDurationMinutesPrimitive, RandomPrimitive, TargetPerMinutePrimitive
Constant Summary collapse
- PRIMITIVES_MAP =
{ "calls" => CallsPrimitive, "random" => RandomPrimitive, "max_duration_minutes" => MaxDurationMinutesPrimitive, "target_per_minute" => TargetPerMinutePrimitive, "max_calls" => MaxCallsPrimitive, }.freeze
Instance Method Summary collapse
-
#initialize(definition) ⇒ Sampler
constructor
A new instance of Sampler.
- #should_sample? ⇒ Boolean
Constructor Details
Instance Method Details
#should_sample? ⇒ Boolean
21 22 23 24 |
# File 'lib/sqreen/ecosystem/tracing/sampler.rb', line 21 def should_sample? line = @lines.find(&:triggers?) line ? line.saved_definition : false end |