Sha256: 087ae26f969f42dfe01f4bca5cd34dc7d2945087a4af178ebde669f7ca228d49

Contents?: true

Size: 691 Bytes

Versions: 11

Compression:

Stored size: 691 Bytes

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

require 'new_relic/agent/sampler'

module NewRelic
  module Agent
    module Samplers
      class ObjectSampler < NewRelic::Agent::Sampler
        def initialize
          super :objects
        end

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

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
newrelic_rpm-3.7.3.204 lib/new_relic/agent/samplers/object_sampler.rb
newrelic_rpm-3.7.3.199 lib/new_relic/agent/samplers/object_sampler.rb
newrelic_rpm-3.7.2.195 lib/new_relic/agent/samplers/object_sampler.rb
newrelic_rpm-3.7.2.192 lib/new_relic/agent/samplers/object_sampler.rb
newrelic_rpm-3.7.2.190.beta lib/new_relic/agent/samplers/object_sampler.rb
newrelic_rpm-3.7.1.188 lib/new_relic/agent/samplers/object_sampler.rb
newrelic_rpm-3.7.1.182 lib/new_relic/agent/samplers/object_sampler.rb
newrelic_rpm-3.7.1.180 lib/new_relic/agent/samplers/object_sampler.rb
newrelic_rpm-3.7.0.177 lib/new_relic/agent/samplers/object_sampler.rb
newrelic_rpm-3.7.0.174.beta lib/new_relic/agent/samplers/object_sampler.rb
newrelic_rpm-3.6.9.171 lib/new_relic/agent/samplers/object_sampler.rb