Class: NewRelic::Agent::StatsEngine Deprecated

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

Deprecated.

This module exists only for backwards-compatibility reasons. Sampler functionality is now controlled by the SamplerManager class.

Defined Under Namespace

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

Constant Summary

Constants included from MetricStats

MetricStats::SCOPE_PLACEHOLDER

Instance Method Summary collapse

Methods included from Transactions

#end_transaction, #pop_scope, #push_scope, #sampler_enabled?, #scope_stack, #start_transaction, #transaction_sampler, #transaction_sampler=, #transaction_stats_hash

Methods included from Samplers

#add_harvest_sampler, #add_sampler

Methods included from MetricStats

#apply_rules_to_metric_data, #clear_stats, #coerce_to_metric_spec_array, #get_stats, #get_stats_no_scope, #harvest_timeslice_data, #in_transaction?, #lookup_stats, #merge!, #metric_specs, #metrics, #record_metrics, #record_metrics_internal, #record_supportability_metric, #record_supportability_metric_count, #record_supportability_metric_timed, #reset_stats

Constructor Details

#initializeStatsEngine

Returns a new instance of StatsEngine.



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

def initialize
  # Makes the unit tests happy
  NewRelic::Agent::TransactionState.get.clear_stats_scope_stack
  @stats_lock = Mutex.new
  @stats_hash = StatsHash.new
end

Instance Method Details

#with_stats_lockObject

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



28
29
30
# File 'lib/new_relic/agent/stats_engine.rb', line 28

def with_stats_lock
  @stats_lock.synchronize { yield }
end