# 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