Class: NewRelic::Agent::Sampler

Inherits:
Object
  • Object
show all
Defined in:
lib/new_relic/agent/sampler.rb

Defined Under Namespace

Classes: Unsupported

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ Sampler

Returns a new instance of Sampler.



39
40
41
# File 'lib/new_relic/agent/sampler.rb', line 39

def initialize(id)
  @id = id
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



17
18
19
# File 'lib/new_relic/agent/sampler.rb', line 17

def id
  @id
end

#stats_engineObject

Returns the value of attribute stats_engine.



16
17
18
# File 'lib/new_relic/agent/sampler.rb', line 16

def stats_engine
  @stats_engine
end

Class Method Details

.inherited(subclass) ⇒ Object



20
21
22
# File 'lib/new_relic/agent/sampler.rb', line 20

def self.inherited(subclass)
  @sampler_classes << subclass
end

.sampler_classesObject



35
36
37
# File 'lib/new_relic/agent/sampler.rb', line 35

def self.sampler_classes
  @sampler_classes
end

.supported_on_this_platform?Boolean

Override with check. Called before instantiating.

Returns:

  • (Boolean)


25
26
27
# File 'lib/new_relic/agent/sampler.rb', line 25

def self.supported_on_this_platform?
  true
end

.use_harvest_sampler?Boolean

Override to use the periodic sampler instead of running the sampler on the minute during harvests.

Returns:

  • (Boolean)


31
32
33
# File 'lib/new_relic/agent/sampler.rb', line 31

def self.use_harvest_sampler?
  true
end

Instance Method Details

#pollObject



43
44
45
# File 'lib/new_relic/agent/sampler.rb', line 43

def poll
  raise "Implement in the subclass"
end