Sha256: 0a984bef311320ec6fc461735a2385156952cbe459ff2fb762a5fb4fb72f95a8

Contents?: true

Size: 503 Bytes

Versions: 3

Compression:

Stored size: 503 Bytes

Contents

# encoding: utf-8

require 'one_apm/agent/sampler'

module OneApm
  module Agent
    module Samplers
      class ObjectSampler < OneApm::Agent::Sampler
        named :object

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
oneapm_rpm-1.1.2 lib/one_apm/agent/samplers/object_sampler.rb
oneapm_rpm-1.1.1 lib/one_apm/agent/samplers/object_sampler.rb
oneapm_rpm-1.1.0 lib/one_apm/agent/samplers/object_sampler.rb