Sha256: ea8980ebbb97f576c0aee550ff585042b5d5f8306d58b7064ba89c51a74815af

Contents?: true

Size: 891 Bytes

Versions: 42

Compression:

Stored size: 891 Bytes

Contents

# encoding: utf-8

require 'one_apm/collector/stats_engine/metric_stats'
require 'one_apm/collector/stats_engine/gc_profiler'
require 'one_apm/collector/stats_engine/stats_hash'

module OneApm
  module Collector
    # This class handles all the statistics gathering for the agent
    class StatsEngine
      include MetricStats

      module Shim
        def add_sampler(*args); end
        def add_harvest_sampler(*args); end
        def start_sampler_thread(*args); end
      end

      attr_accessor :metric_rules

      def initialize
        @stats_lock   = Mutex.new
        @stats_hash   = StatsHash.new
        @metric_rules = OneApm::Support::RulesEngine.new
      end

      # All access to the @stats_hash ivar should be funnelled through this
      # method to ensure thread-safety.
      def with_stats_lock
        @stats_lock.synchronize { yield }
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
oneapm_rpm-1.2.9.rc1 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.2.8 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.2.8.rc1 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.2.7 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.2.7.rc1 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.2.6 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.2.6.rc1 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.2.5 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.2.5.rc1 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.2.4 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.2.4.rc1 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.2.3 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.2.3.rc2 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.2.2 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.2.2.rc lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.2.1 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.2.1.rc lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.2.0 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.1.3 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.1.2 lib/one_apm/collector/containers/stats_engine.rb