Class: NewRelic::Agent::StatsEngine::GCProfiler::CoreGCProfiler

Inherits:
Object
  • Object
show all
Defined in:
lib/new_relic/agent/stats_engine/gc_profiler.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.enabled?Boolean

Returns:

  • (Boolean)


86
87
88
# File 'lib/new_relic/agent/stats_engine/gc_profiler.rb', line 86

def self.enabled?
  NewRelic::LanguageSupport.gc_profiler_enabled?
end

Instance Method Details

#call_countObject



94
95
96
# File 'lib/new_relic/agent/stats_engine/gc_profiler.rb', line 94

def call_count
  ::GC.count
end

#call_time_sObject



90
91
92
# File 'lib/new_relic/agent/stats_engine/gc_profiler.rb', line 90

def call_time_s
  NewRelic::Agent.instance.monotonic_gc_profiler.total_time_s
end

#resetObject

When using GC::Profiler, it’s important to periodically call GC::Profiler.clear in order to avoid unbounded growth in the number of GC records that are stored. However, we actually do this internally within MonotonicGCProfiler on calls to #total_time_s, so the reset here is a no-op.



103
# File 'lib/new_relic/agent/stats_engine/gc_profiler.rb', line 103

def reset; end