Sha256: 0f239803658d5d48c755dd0ccf86e0a629e0dbd818832474acb0e5ad34c7515b

Contents?: true

Size: 385 Bytes

Versions: 9

Compression:

Stored size: 385 Bytes

Contents

module PulseMeter
  module Sensor
    module Timelined
      # Counts events per interval
      class Counter < Timeline
        def aggregate_event(key, value)
          redis.incrby(key, value.to_i)
        end

        def summarize(key)
          redis.get(key)
        end

        private

        def deflate(value)
          value.to_i
        end

      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
pulse-meter-0.3.1 lib/pulse-meter/sensor/timelined/counter.rb
pulse-meter-0.3.0 lib/pulse-meter/sensor/timelined/counter.rb
pulse-meter-0.2.11 lib/pulse-meter/sensor/timelined/counter.rb
pulse-meter-0.2.10 lib/pulse-meter/sensor/timelined/counter.rb
pulse-meter-0.2.9 lib/pulse-meter/sensor/timelined/counter.rb
pulse-meter-0.2.8 lib/pulse-meter/sensor/timelined/counter.rb
pulse-meter-0.2.7 lib/pulse-meter/sensor/timelined/counter.rb
pulse-meter-0.2.6 lib/pulse-meter/sensor/timelined/counter.rb
pulse-meter-0.2.5 lib/pulse-meter/sensor/timelined/counter.rb