module SystemMetrics
Constants
- VERSION
Public Class Methods
collecting?()
click to toggle source
# File lib/system_metrics.rb, line 18 def collecting? Thread.current[:system_metrics_collecting] || false end
collection_off()
click to toggle source
# File lib/system_metrics.rb, line 14 def self.collection_off Thread.current[:system_metrics_collecting] = false end
collection_on()
click to toggle source
# File lib/system_metrics.rb, line 10 def self.collection_on Thread.current[:system_metrics_collecting] = true end
without_collection() { || ... }
click to toggle source
# File lib/system_metrics.rb, line 22 def without_collection previously_collecting = collecting? SystemMetrics.collection_off yield if block_given? ensure SystemMetrics.collection_on if previously_collecting end
Private Instance Methods
collecting?()
click to toggle source
# File lib/system_metrics.rb, line 18 def collecting? Thread.current[:system_metrics_collecting] || false end
without_collection() { || ... }
click to toggle source
# File lib/system_metrics.rb, line 22 def without_collection previously_collecting = collecting? SystemMetrics.collection_off yield if block_given? ensure SystemMetrics.collection_on if previously_collecting end