Class: Jaeger::Client::Samplers::Const
- Inherits:
-
Object
- Object
- Jaeger::Client::Samplers::Const
- Defined in:
- lib/jaeger/client/samplers/const.rb
Overview
Const sampler
A sampler that always makes the same decision for new traces depending on the initialization value. Use ‘Jaeger::Client::Samplers::Const.new(true)` to mark all new traces as sampled.
Instance Attribute Summary collapse
-
#param ⇒ Object
readonly
Returns the value of attribute param.
Instance Method Summary collapse
-
#initialize(decision) ⇒ Const
constructor
A new instance of Const.
- #sample? ⇒ Boolean
- #type ⇒ Object
Constructor Details
#initialize(decision) ⇒ Const
Returns a new instance of Const.
12 13 14 15 |
# File 'lib/jaeger/client/samplers/const.rb', line 12 def initialize(decision) @decision = decision @param = decision ? '1' : '0' end |
Instance Attribute Details
#param ⇒ Object (readonly)
Returns the value of attribute param.
25 26 27 |
# File 'lib/jaeger/client/samplers/const.rb', line 25 def param @param end |
Instance Method Details
#sample? ⇒ Boolean
17 18 19 |
# File 'lib/jaeger/client/samplers/const.rb', line 17 def sample?(*) @decision end |
#type ⇒ Object
21 22 23 |
# File 'lib/jaeger/client/samplers/const.rb', line 21 def type 'const' end |