Sha256: 5b3a64ce677aacc6c4f693d7ad6581a06b09c6a79d70f739ffe5906c049672c5
Contents?: true
Size: 975 Bytes
Versions: 3
Compression:
Stored size: 975 Bytes
Contents
module Barnes module Instruments class Ruby18GC def initialize GC.enable_stats end def start!(state) state[:ruby18_gc] = current end def instrument!(state, counters, gauges) last = state[:ruby18_gc] cur = state[:ruby18_gc] = current counters.update \ :'GC.count' => cur[:gc_count] - before[:gc_count], :'GC.time' => cur[:gc_time] - before[:gc_time], :'GC.memory' => cur[:gc_memory] - before[:gc_memory], :'GC.allocated_objects' => cur[:objects] - before[:objects] gauges[:'Objects.live'] = ObjectSpace.live_objects gauges[:'GC.growth'] = GC.growth end private def current { :objects => ObjectSpace.allocated_objects, :gc_count => GC.collections, :gc_time => GC.time, :gc_memory => GC.allocated_size } end end end end
Version data entries
3 entries across 3 versions & 1 rubygems