Class: Zipkin::Samplers::Const

Inherits:
Object
  • Object
show all
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

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

Returns:

  • (Boolean)


15
16
17
# File 'lib/zipkin/samplers/const.rb', line 15

def sample?(*)
  @decision
end