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.4.2 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.4.1 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.4.0 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.3.7 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.3.7.rc1 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.3.6 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.3.6.rc1 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.3.5 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.3.5.rc1 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.3.4 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.3.4.rc1 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.3.3 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.3.3.rc1 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.3.2 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.3.2.rc1 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.3.1 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.3.1.rc1 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.3.0 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.3.0.rc1 lib/one_apm/collector/containers/stats_engine.rb
oneapm_rpm-1.2.9 lib/one_apm/collector/containers/stats_engine.rb