Sha256: 20787b60d5f6c56d9761e28a6bbe70711009e3413973d82b13f9ce14e87dec5f

Contents?: true

Size: 488 Bytes

Versions: 24

Compression:

Stored size: 488 Bytes

Contents

require "cabin/namespace"
require "cabin/metric"

class Cabin::Metrics::Gauge
  include Cabin::Metric

  # A new Gauge. The block given will be called every time the metric is read.
  public
  def initialize(&block)
    @inspectables = [ ]
    @block = block
  end # def initialize

  # Get the value of this metric.
  public
  def value
    return @block.call
  end # def value

  public
  def to_hash
    return { :value => value }
  end # def to_hash
end # class Cabin::Metrics::Gauge

Version data entries

24 entries across 22 versions & 6 rubygems

Version Path
logstash-filter-zabbix-0.1.2 vendor/bundle/jruby/1.9/gems/cabin-0.8.1/lib/cabin/metrics/gauge.rb
logstash-filter-zabbix-0.1.1 vendor/bundle/jruby/1.9/gems/cabin-0.8.1/lib/cabin/metrics/gauge.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/cabin-0.8.1/lib/cabin/metrics/gauge.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/cabin-0.8.1/lib/cabin/metrics/gauge.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/cabin-0.8.1/lib/cabin/metrics/gauge.rb
cabin-0.9.0 lib/cabin/metrics/gauge.rb
able-neo4j-1.0.0 vendor/bundle/jruby/1.9/gems/cabin-0.7.1/lib/cabin/metrics/gauge.rb
cabin-0.8.1 lib/cabin/metrics/gauge.rb
cabin-0.8.0 lib/cabin/metrics/gauge.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/logstash-codec-json-2.0.3/vendor/gems/cabin-0.7.2/lib/cabin/metrics/gauge.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/cabin-0.7.1/lib/cabin/metrics/gauge.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/cabin-0.7.2/lib/cabin/metrics/gauge.rb
logstash-codec-json-2.0.3 vendor/gems/cabin-0.7.2/lib/cabin/metrics/gauge.rb
cabin-0.7.2 lib/cabin/metrics/gauge.rb
logstash-input-beats-0.9.2 vendor/jruby/1.9/gems/cabin-0.7.1/lib/cabin/metrics/gauge.rb
logstash-input-beats-0.9.1 vendor/jruby/1.9/gems/cabin-0.7.1/lib/cabin/metrics/gauge.rb
cabin-0.7.1 lib/cabin/metrics/gauge.rb
cabin-0.6.1 lib/cabin/metrics/gauge.rb
cabin-0.6.0 lib/cabin/metrics/gauge.rb
cabin-0.5.0 lib/cabin/metrics/gauge.rb