Sha256: 8807e6cbb698358e032dd3edd6dabbb36dee92b2cdf37d4fb98a07e27c00e9cf

Contents?: true

Size: 505 Bytes

Versions: 1

Compression:

Stored size: 505 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::Manager.record_metric("GC/objects", live_objects)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
oneapm_rpm-1.1.3 lib/one_apm/agent/samplers/object_sampler.rb