Module: Leafy::Metrics::JRubyMetrics
- Defined in:
- lib/leafy/metrics/jruby_metrics.rb
Class Method Summary collapse
-
.register_ruby_thread_state_gauges(registry, name) ⇒ Object
registers a few thread gauges under the given basename: total.com, executing.count and sleeping.count.
Class Method Details
.register_ruby_thread_state_gauges(registry, name) ⇒ Object
registers a few thread gauges under the given basename: total.com, executing.count and sleeping.count
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/leafy/metrics/jruby_metrics.rb', line 11 def self.register_ruby_thread_state_gauges( registry, name ) registry.register_gauge( name + '.total.count' ) do Thread.list.size end registry.register_gauge( name + '.executing.count' ) do Thread.list.select { |t| t.status == 'run' }.size end registry.register_gauge( name + '.sleeping.count' ) do Thread.list.select { |t| t.status == 'sleep' }.size end end |