Class: Sqreen::Ecosystem::Tracing::Sampler::MaxDurationMinutesPrimitive
- Inherits:
-
Object
- Object
- Sqreen::Ecosystem::Tracing::Sampler::MaxDurationMinutesPrimitive
- Defined in:
- lib/sqreen/ecosystem/tracing/sampler.rb
Instance Method Summary collapse
-
#initialize(time_in_minutes) ⇒ MaxDurationMinutesPrimitive
constructor
A new instance of MaxDurationMinutesPrimitive.
- #triggers? ⇒ Boolean
Constructor Details
#initialize(time_in_minutes) ⇒ MaxDurationMinutesPrimitive
Returns a new instance of MaxDurationMinutesPrimitive.
93 94 95 96 |
# File 'lib/sqreen/ecosystem/tracing/sampler.rb', line 93 def initialize(time_in_minutes) @deadline = Sqreen.time + time_in_minutes * 60 @passed = false # no locking needed end |
Instance Method Details
#triggers? ⇒ Boolean
98 99 100 101 102 103 104 105 |
# File 'lib/sqreen/ecosystem/tracing/sampler.rb', line 98 def triggers? return false if @passed if Sqreen.time > @deadline @passed = true return false end true end |