Class: Jaeger::Samplers::Const
- Inherits:
-
Object
- Object
- Jaeger::Samplers::Const
- Defined in:
- lib/jaeger/samplers/const.rb
Overview
Const sampler
A sampler that always makes the same decision for new traces depending on the initialization value. Use ‘Jaeger::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 ⇒ Object
Constructor Details
#initialize(decision) ⇒ Const
Returns a new instance of Const.
11 12 13 14 15 16 17 |
# File 'lib/jaeger/samplers/const.rb', line 11 def initialize(decision) @decision = decision @tags = { 'sampler.type' => 'const', 'sampler.param' => @decision ? 1 : 0 } end |
Instance Method Details
#sample ⇒ Object
19 20 21 |
# File 'lib/jaeger/samplers/const.rb', line 19 def sample(*) [@decision, @tags] end |