Class: NewRelic::Agent::Samplers::ObjectSampler

Inherits:
NewRelic::Agent::Sampler show all
Defined in:
lib/new_relic/agent/samplers/object_sampler.rb

Instance Attribute Summary

Attributes inherited from NewRelic::Agent::Sampler

#id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from NewRelic::Agent::Sampler

enabled?, inherited, #initialize, named, sampler_classes

Constructor Details

This class inherits a constructor from NewRelic::Agent::Sampler

Class Method Details

.supported_on_this_platform?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/new_relic/agent/samplers/object_sampler.rb', line 13

def self.supported_on_this_platform?
  NewRelic::LanguageSupport.object_space_usable? && ObjectSpace.respond_to?(:live_objects)
end

Instance Method Details

#pollObject



17
18
19
20
# File 'lib/new_relic/agent/samplers/object_sampler.rb', line 17

def poll
  live_objects = ObjectSpace.live_objects
  NewRelic::Agent.record_metric('GC/objects', live_objects)
end