Class: NewRelic::Agent::StatsEngine::GCProfiler::RailsBench

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Profiler

#capture, #initialize

Constructor Details

This class inherits a constructor from NewRelic::Agent::StatsEngine::GCProfiler::Profiler

Class Method Details

.enabled?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/new_relic/agent/stats_engine/gc_profiler.rb', line 60

def self.enabled?
  ::GC.respond_to?(:time) && ::GC.respond_to?(:collections)
end

Instance Method Details

#call_countObject



69
70
71
# File 'lib/new_relic/agent/stats_engine/gc_profiler.rb', line 69

def call_count
  ::GC.collections
end

#call_timeObject

microseconds spent in GC



65
66
67
# File 'lib/new_relic/agent/stats_engine/gc_profiler.rb', line 65

def call_time
  ::GC.time # this should already be microseconds
end

#resetObject



73
74
75
# File 'lib/new_relic/agent/stats_engine/gc_profiler.rb', line 73

def reset
  ::GC.clear_stats
end