class Cabin::Metrics::Gauge
Public Class Methods
Source
# File lib/cabin/metrics/gauge.rb, line 9 def initialize(&block) @inspectables = [ ] @block = block end
A new Gauge
. The block given will be called every time the metric is read.
Public Instance Methods
Source
# File lib/cabin/metrics/gauge.rb, line 21 def to_hash return { :value => value } end
Source
# File lib/cabin/metrics/gauge.rb, line 16 def value return @block.call end
Get the value of this metric.