Class: NewRelic::Agent::StatsEngine

Inherits:
Object
  • Object
show all
Includes:
MetricStats, Samplers, Transactions
Defined in:
lib/new_relic/agent/stats_engine.rb,
lib/new_relic/agent/stats_engine/samplers.rb,
lib/new_relic/agent/stats_engine/gc_profiler.rb,
lib/new_relic/agent/stats_engine/metric_stats.rb,
lib/new_relic/agent/stats_engine/transactions.rb

Overview

This class handles all the statistics gathering for the agent

Defined Under Namespace

Modules: GCProfiler, MetricStats, Samplers, Shim, Transactions Classes: ScopeStackElement

Constant Summary

Constants included from Samplers

Samplers::POLL_PERIOD

Instance Method Summary collapse

Methods included from Transactions

#end_transaction, #peek_scope, #pop_scope, #push_scope, #remove_transaction_sampler, #sampler_enabled?, #scope_name, #scope_name=, #start_transaction, #transaction_sampler=

Methods included from Samplers

#add_harvest_sampler, #add_sampler, #start_sampler_thread

Methods included from MetricStats

#clear_stats, #get_custom_stats, #get_stats, #get_stats_no_scope, #harvest_timeslice_data, #lookup_stats, #metrics, #record_supportability_metrics, #record_supportability_metrics_count, #record_supportability_metrics_timed, #reset_stats, #stats_hash

Methods included from MetricStats::Harvest

#merge_data

Constructor Details

#initializeStatsEngine

Returns a new instance of StatsEngine.



14
15
16
17
18
# File 'lib/new_relic/agent/stats_engine.rb', line 14

def initialize
  # Makes the unit tests happy
  Thread::current[:newrelic_scope_stack] = nil
  start_sampler_thread
end

Instance Method Details

#logObject



20
21
22
# File 'lib/new_relic/agent/stats_engine.rb', line 20

def log
  NewRelic::Control.instance.log
end