Sha256: ded0f3b8eb7c7e8fff159a45df5a23498cbb339a035471e660b060de0f1e8fe0
Contents?: true
Size: 701 Bytes
Versions: 42
Compression:
Stored size: 701 Bytes
Contents
# encoding: utf-8 require 'thread' require 'one_apm/support/vm/snapshot' module OneApm module Support module VM class JRubyVM def snapshot snap = Snapshot.new gather_stats(snap) snap end 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 def supports?(key) case key when :gc_runs RUBY_VERSION >= "1.9.2" when :thread_count true else false end end end end end end
Version data entries
42 entries across 42 versions & 1 rubygems