Class: NewRelic::Agent::Samplers::ObjectSampler
- Inherits:
-
NewRelic::Agent::Sampler
- Object
- NewRelic::Agent::Sampler
- NewRelic::Agent::Samplers::ObjectSampler
- Defined in:
- lib/new_relic/agent/samplers/object_sampler.rb
Instance Attribute Summary
Attributes inherited from NewRelic::Agent::Sampler
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ ObjectSampler
constructor
A new instance of ObjectSampler.
- #poll ⇒ Object
Methods inherited from NewRelic::Agent::Sampler
Constructor Details
#initialize ⇒ ObjectSampler
Returns a new instance of ObjectSampler.
11 12 13 |
# File 'lib/new_relic/agent/samplers/object_sampler.rb', line 11 def initialize super :objects end |
Class Method Details
.supported_on_this_platform? ⇒ Boolean
15 16 17 |
# File 'lib/new_relic/agent/samplers/object_sampler.rb', line 15 def self.supported_on_this_platform? NewRelic::LanguageSupport.object_space_enabled? && ObjectSpace.respond_to?(:live_objects) end |
Instance Method Details
#poll ⇒ Object
19 20 21 22 |
# File 'lib/new_relic/agent/samplers/object_sampler.rb', line 19 def poll live_objects = ObjectSpace.live_objects NewRelic::Agent.record_metric("GC/objects", live_objects) end |