Class: TimeBandits::TimeConsumers::JMX
- Inherits:
-
Object
- Object
- TimeBandits::TimeConsumers::JMX
- Defined in:
- lib/time_bandits/time_consumers/jmx.rb
Class Method Summary collapse
Instance Method Summary collapse
- #allocated_objects ⇒ Object
- #collections_delta ⇒ Object
- #consumed ⇒ Object
- #gc_collections ⇒ Object
- #gc_time ⇒ Object
- #gc_time_delta ⇒ Object
- #heap_growth ⇒ Object
- #heap_size ⇒ Object
- #heap_usage ⇒ Object
- #reset ⇒ Object
- #runtime ⇒ Object
- #usage_growth ⇒ Object
Class Method Details
.instance ⇒ Object
22 23 24 |
# File 'lib/time_bandits/time_consumers/jmx.rb', line 22 def self.instance @instance ||= new end |
Instance Method Details
#allocated_objects ⇒ Object
69 70 71 |
# File 'lib/time_bandits/time_consumers/jmx.rb', line 69 def allocated_objects 0 end |
#collections_delta ⇒ Object
53 54 55 |
# File 'lib/time_bandits/time_consumers/jmx.rb', line 53 def collections_delta gc_collections - @collections end |
#consumed ⇒ Object
26 27 28 |
# File 'lib/time_bandits/time_consumers/jmx.rb', line 26 def consumed 0.0 end |
#gc_collections ⇒ Object
34 35 36 |
# File 'lib/time_bandits/time_consumers/jmx.rb', line 34 def gc_collections @collectors.to_array.map {|gc| @server[gc].collection_count}.sum end |
#gc_time ⇒ Object
30 31 32 |
# File 'lib/time_bandits/time_consumers/jmx.rb', line 30 def gc_time @collectors.to_array.map {|gc| @server[gc].collection_time}.sum end |
#gc_time_delta ⇒ Object
57 58 59 |
# File 'lib/time_bandits/time_consumers/jmx.rb', line 57 def gc_time_delta (gc_time - @consumed).to_f end |
#heap_growth ⇒ Object
61 62 63 |
# File 'lib/time_bandits/time_consumers/jmx.rb', line 61 def heap_growth heap_size - @heap_committed end |
#heap_size ⇒ Object
38 39 40 |
# File 'lib/time_bandits/time_consumers/jmx.rb', line 38 def heap_size @memory_bean.heap_memory_usage.committed end |
#heap_usage ⇒ Object
42 43 44 |
# File 'lib/time_bandits/time_consumers/jmx.rb', line 42 def heap_usage @memory_bean.heap_memory_usage.used end |
#reset ⇒ Object
46 47 48 49 50 51 |
# File 'lib/time_bandits/time_consumers/jmx.rb', line 46 def reset @consumed = gc_time @collections = gc_collections @heap_committed = heap_size @heap_used = heap_usage end |
#runtime ⇒ Object
73 74 75 |
# File 'lib/time_bandits/time_consumers/jmx.rb', line 73 def runtime "GC: %.3f(%d), HP: %d(%d,%d,%d)" % [gc_time_delta, collections_delta, heap_growth, heap_size, allocated_objects, usage_growth] end |
#usage_growth ⇒ Object
65 66 67 |
# File 'lib/time_bandits/time_consumers/jmx.rb', line 65 def usage_growth heap_usage - @heap_used end |