require 'ganymed/sampler/datasource' module Ganymed class Sampler ## # A Gauge is the simplest DataSource type. It simply records the given # value in the buffer and emits all values in the buffer upon flush # assuming the given values are in gauge-style (e.g. free memory, users # currently logged in, etc). # class Gauge < DataSource def flush(tick, &block) each(tick) do |ns, origin, values| yield ns, origin, values end end def feed(ns, origin, ts, value) add(ns, origin, value) end end end end