Class: NewRelic::Agent::Sampler
- Inherits:
-
Object
- Object
- NewRelic::Agent::Sampler
show all
- Defined in:
- lib/new_relic/agent/sampler.rb
Defined Under Namespace
Classes: Unsupported
Class Attribute Summary collapse
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
-
#initialize(id = nil) ⇒ Sampler
constructor
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.
-
#poll ⇒ Object
Constructor Details
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.
[View source]
55
56
57
|
# File 'lib/new_relic/agent/sampler.rb', line 55
def initialize(id = nil)
@id = id || self.class.shorthand_name
end
|
Class Attribute Details
permalink
.shorthand_name ⇒ Object
23
24
25
|
# File 'lib/new_relic/agent/sampler.rb', line 23
def shorthand_name
@shorthand_name
end
|
Instance Attribute Details
19
20
21
|
# File 'lib/new_relic/agent/sampler.rb', line 19
def id
@id
end
|
Class Method Details
permalink
.enabled? ⇒ Boolean
[View source]
39
40
41
42
43
44
45
46
|
# 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
|
permalink
.inherited(subclass) ⇒ Object
[View source]
30
31
32
|
# File 'lib/new_relic/agent/sampler.rb', line 30
def self.inherited(subclass)
@sampler_classes << subclass
end
|
permalink
.named(new_name) ⇒ Object
[View source]
26
27
28
|
# File 'lib/new_relic/agent/sampler.rb', line 26
def self.named(new_name)
@shorthand_name = new_name
end
|
permalink
.sampler_classes ⇒ Object
[View source]
48
49
50
|
# File 'lib/new_relic/agent/sampler.rb', line 48
def self.sampler_classes
@sampler_classes
end
|
Override with check. Called before instantiating.
[View source]
35
36
37
|
# File 'lib/new_relic/agent/sampler.rb', line 35
def self.supported_on_this_platform?
true
end
|
Instance Method Details
[View source]
59
60
61
|
# File 'lib/new_relic/agent/sampler.rb', line 59
def poll
raise 'Implement in the subclass'
end
|