Module: Remnant::GC::Profiler::ClassMethods
- Included in:
- Remnant::GC::Profiler
- Defined in:
- lib/remnant/gc/profiler.rb
Instance Method Summary collapse
- #clear_stats ⇒ Object
- #collections ⇒ Object
- #disable_stats ⇒ Object
- #enable_stats ⇒ Object
- #enabled? ⇒ Boolean
- #raw_data ⇒ Object
- #time ⇒ Object
Instance Method Details
#clear_stats ⇒ Object
30 31 32 33 |
# File 'lib/remnant/gc/profiler.rb', line 30 def clear_stats @raw_data = nil ::GC::Profiler.clear end |
#collections ⇒ Object
18 19 20 |
# File 'lib/remnant/gc/profiler.rb', line 18 def collections raw_data.size end |
#disable_stats ⇒ Object
26 27 28 |
# File 'lib/remnant/gc/profiler.rb', line 26 def disable_stats ::GC::Profiler.disable end |
#enable_stats ⇒ Object
22 23 24 |
# File 'lib/remnant/gc/profiler.rb', line 22 def enable_stats ::GC::Profiler.enable end |
#enabled? ⇒ Boolean
5 6 7 |
# File 'lib/remnant/gc/profiler.rb', line 5 def enabled? ::GC::Profiler.enabled? end |
#raw_data ⇒ Object
14 15 16 |
# File 'lib/remnant/gc/profiler.rb', line 14 def raw_data @raw_data ||= ::GC::Profiler.raw_data || [] end |
#time ⇒ Object
9 10 11 12 |
# File 'lib/remnant/gc/profiler.rb', line 9 def time # returns time in seconds so convert to ms @time ||= raw_data.map {|data| data[:GC_TIME]}.sum * 1000 end |