Class: NewRelic::Agent::StatsEngine::GCProfiler::Rubinius

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, #reset

Constructor Details

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

Class Method Details

.enabled?Boolean

Returns:

  • (Boolean)


99
100
101
102
103
104
105
106
# File 'lib/new_relic/agent/stats_engine/gc_profiler.rb', line 99

def self.enabled?
  if NewRelic::LanguageSupport.using_engine?('rbx')
    require 'rubinius/agent'
    true
  else
    false
  end
end

Instance Method Details

#call_countObject



114
115
116
117
118
# File 'lib/new_relic/agent/stats_engine/gc_profiler.rb', line 114

def call_count
  agent = ::Rubinius::Agent.loopback
  agent.get('system.gc.young.count')[1] +
    agent.get('system.gc.full.count')[1]
end

#call_timeObject



108
109
110
111
112
# File 'lib/new_relic/agent/stats_engine/gc_profiler.rb', line 108

def call_time
  agent = ::Rubinius::Agent.loopback
  (agent.get('system.gc.young.total_wallclock')[1] +
    agent.get('system.gc.full.total_wallclock')[1]) * 1000
end