class NewRelic::Agent::VM::JRubyVM

Public Instance Methods

gather_stats(snap) click to toggle source
# File lib/new_relic/agent/vm/jruby_vm.rb, line 17
def gather_stats(snap)
  if supports?(:gc_runs)
    gc_stats = GC.stat
    snap.gc_runs = gc_stats[:count]
  end

  snap.thread_count = Thread.list.size
end
snapshot() click to toggle source
# File lib/new_relic/agent/vm/jruby_vm.rb, line 11
def snapshot
  snap = Snapshot.new
  gather_stats(snap)
  snap
end
supports?(key) click to toggle source
# File lib/new_relic/agent/vm/jruby_vm.rb, line 26
def supports?(key)
  case key
  when :gc_runs
    RUBY_VERSION >= "1.9.2"
  when :thread_count
    true
  else
    false
  end
end