Class: OneApm::Collector::StatsEngine

Inherits:
Object
  • Object
show all
Includes:
MetricStats
Defined in:
lib/one_apm/collector/containers/stats_engine.rb,
lib/one_apm/collector/stats_engine/gc_profiler.rb,
lib/one_apm/collector/stats_engine/metric_stats.rb

Overview

This class handles all the statistics gathering for the agent

Defined Under Namespace

Modules: GCProfiler, MetricStats, Shim

Constant Summary

Constants included from MetricStats

MetricStats::OA_SCOPE_PLACEHOLDER

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from MetricStats

#apply_rules_to_metric_data, #clear_stats, #coerce_to_metric_spec_array, #get_stats, #get_stats_no_scope, #harvest!, #lookup_stats, #merge!, #merge_transaction_metrics!, #metric_specs, #metrics, #record_scoped_and_unscoped_metrics, #record_unscoped_metrics, #reset!, #tl_record_scoped_and_unscoped_metrics, #tl_record_supportability_metric_count, #tl_record_unscoped_metrics

Constructor Details

#initializeStatsEngine

Returns a new instance of StatsEngine.



21
22
23
24
25
# File 'lib/one_apm/collector/containers/stats_engine.rb', line 21

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

Instance Attribute Details

#metric_rulesObject

Returns the value of attribute metric_rules.



19
20
21
# File 'lib/one_apm/collector/containers/stats_engine.rb', line 19

def metric_rules
  @metric_rules
end

Instance Method Details

#with_stats_lockObject

All access to the @stats_hash ivar should be funnelled through this method to ensure thread-safety.



29
30
31
# File 'lib/one_apm/collector/containers/stats_engine.rb', line 29

def with_stats_lock
  @stats_lock.synchronize { yield }
end