Sha256: 4e4779a0326bca59a31bc666c7d175550d9d9faad1c5630924452056750c7332

Contents?: true

Size: 604 Bytes

Versions: 7

Compression:

Stored size: 604 Bytes

Contents

module PulseMeter
  module Sensor
    module Timelined
      class ZSetBased < Timeline

        def update(_)
        end

        def calculate(key)
          0
        end

        def aggregate_event(key, value)
          command_aggregator.zadd(key, value, "#{value}::#{uniqid}")
          update(key)
        end

        def summarize(key)
          count = redis.zcard(key)
          if count > 0
            calculate(key, count)
          else
            nil
          end
        end

        private

        def deflate(value)
          value.to_f
        end

      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pulse_meter_core-0.5.5 lib/pulse_meter/sensor/timelined/zset_based.rb
pulse_meter_core-0.5.4 lib/pulse_meter/sensor/timelined/zset_based.rb
pulse_meter_core-0.5.3 lib/pulse_meter/sensor/timelined/zset_based.rb
pulse_meter_core-0.5.2 lib/pulse_meter/sensor/timelined/zset_based.rb
pulse_meter_core-0.5.1 lib/pulse_meter/sensor/timelined/zset_based.rb
pulse_meter_core-0.5.0 lib/pulse_meter/sensor/timelined/zset_based.rb
pulse_meter_core-0.4.13 lib/pulse_meter/sensor/timelined/zset_based.rb