class NewRelic::Agent::Sampler
Attributes
Public Class Methods
Source
# File lib/new_relic/agent/sampler.rb, line 39 def self.enabled? if shorthand_name config_key = "disable_#{shorthand_name}_sampler" !(Agent.config[config_key]) else true end end
Source
# File lib/new_relic/agent/sampler.rb, line 30 def self.inherited(subclass) @sampler_classes << subclass end
Source
# File lib/new_relic/agent/sampler.rb, line 26 def self.named(new_name) @shorthand_name = new_name end
Source
# File lib/new_relic/agent/sampler.rb, line 55 def initialize(id = nil) @id = id || self.class.shorthand_name end
The ID passed in here is unused by our code, but is preserved in case we have clients who are defining their own subclasses of this class, and expecting to be able to call super with an ID.
Source
# File lib/new_relic/agent/sampler.rb, line 48 def self.sampler_classes @sampler_classes end
Source
# File lib/new_relic/agent/sampler.rb, line 35 def self.supported_on_this_platform? true end
Override with check. Called before instantiating.
Public Instance Methods
Source
# File lib/new_relic/agent/sampler.rb, line 59 def poll raise 'Implement in the subclass' end