Sha256: 03fc3f91ab0fcf84f5f2f5dcefe9d86a8acce5c9d2a76ee7b448a2423ee00303

Contents?: true

Size: 692 Bytes

Versions: 7

Compression:

Stored size: 692 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_enabled? && 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

7 entries across 7 versions & 1 rubygems

Version Path
newrelic_rpm-3.6.8.168 lib/new_relic/agent/samplers/object_sampler.rb
newrelic_rpm-3.6.8.164 lib/new_relic/agent/samplers/object_sampler.rb
newrelic_rpm-3.6.7.159 lib/new_relic/agent/samplers/object_sampler.rb
newrelic_rpm-3.6.7.159.beta lib/new_relic/agent/samplers/object_sampler.rb
newrelic_rpm-3.6.7.152 lib/new_relic/agent/samplers/object_sampler.rb
newrelic_rpm-3.6.6.147 lib/new_relic/agent/samplers/object_sampler.rb
newrelic_rpm-3.6.5.130 lib/new_relic/agent/samplers/object_sampler.rb