Sha256: fb33e23da68595183658471ee58500cf67b144d3df15aa09166d05a074453689

Contents?: true

Size: 398 Bytes

Versions: 9

Compression:

Stored size: 398 Bytes

Contents

module PulseMeter
  module Sensor
    module Timelined
      # Counts unique events per interval
      class UniqCounter < Timeline
        def aggregate_event(key, value)
          redis.sadd(key, value)
        end

        def summarize(key)
          redis.scard(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/uniq_counter.rb
pulse-meter-0.3.0 lib/pulse-meter/sensor/timelined/uniq_counter.rb
pulse-meter-0.2.11 lib/pulse-meter/sensor/timelined/uniq_counter.rb
pulse-meter-0.2.10 lib/pulse-meter/sensor/timelined/uniq_counter.rb
pulse-meter-0.2.9 lib/pulse-meter/sensor/timelined/uniq_counter.rb
pulse-meter-0.2.8 lib/pulse-meter/sensor/timelined/uniq_counter.rb
pulse-meter-0.2.7 lib/pulse-meter/sensor/timelined/uniq_counter.rb
pulse-meter-0.2.6 lib/pulse-meter/sensor/timelined/uniq_counter.rb
pulse-meter-0.2.5 lib/pulse-meter/sensor/timelined/uniq_counter.rb