Class: OneApm::Collector::Samplers::ObjectSampler

Inherits:
OneApm::Collector::Sampler show all
Defined in:
lib/one_apm/collector/samplers/object_sampler.rb

Instance Attribute Summary

Attributes inherited from OneApm::Collector::Sampler

#id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from OneApm::Collector::Sampler

enabled?, inherited, #initialize, name, named, sampler_classes

Constructor Details

This class inherits a constructor from OneApm::Collector::Sampler

Class Method Details

.supported_on_this_platform?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/one_apm/collector/samplers/object_sampler.rb', line 11

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

Instance Method Details

#pollObject



15
16
17
18
# File 'lib/one_apm/collector/samplers/object_sampler.rb', line 15

def poll
  live_objects = ObjectSpace.live_objects
  OneApm::Manager.record_metric("GC/objects", live_objects)
end