Class: Zipkin::Samplers::Const
- Inherits:
-
Object
- Object
- Zipkin::Samplers::Const
- Defined in:
- lib/zipkin/samplers/const.rb
Overview
Const sampler
A sampler that always makes the same decision for new traces depending on the initialization value. Use ‘Zipkin::Samplers::Const.new(true)` to mark all new traces as sampled.
Instance Method Summary collapse
-
#initialize(decision) ⇒ Const
constructor
A new instance of Const.
- #sample? ⇒ Boolean
Constructor Details
#initialize(decision) ⇒ Const
Returns a new instance of Const.
11 12 13 |
# File 'lib/zipkin/samplers/const.rb', line 11 def initialize(decision) @decision = decision end |
Instance Method Details
#sample? ⇒ Boolean
15 16 17 |
# File 'lib/zipkin/samplers/const.rb', line 15 def sample?(*) @decision end |