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)


103
104
105
106
107
108
109
110
# File 'lib/new_relic/agent/stats_engine/gc_profiler.rb', line 103

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

Instance Method Details

#call_countObject



118
119
120
121
122
# File 'lib/new_relic/agent/stats_engine/gc_profiler.rb', line 118

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

#call_timeObject



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

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