Class: PulseMeter::Sensor::Timelined::ZSetBased
- Inherits:
-
PulseMeter::Sensor::Timeline
- Object
- Base
- PulseMeter::Sensor::Timeline
- PulseMeter::Sensor::Timelined::ZSetBased
- Defined in:
- lib/pulse-meter/sensor/timelined/zset_based.rb
Overview
Calculates min value in interval
Direct Known Subclasses
Constant Summary
Constants inherited from PulseMeter::Sensor::Timeline
PulseMeter::Sensor::Timeline::DEFAULTS, PulseMeter::Sensor::Timeline::MAX_TIMESPAN_POINTS
Constants included from PulseMeter::Sensor::TimelineReduce
PulseMeter::Sensor::TimelineReduce::MAX_INTERVALS
Constants included from Mixins::Dumper
Mixins::Dumper::DUMP_REDIS_KEY
Instance Attribute Summary
Attributes inherited from PulseMeter::Sensor::Timeline
#interval, #raw_data_ttl, #reduce_delay, #ttl
Attributes inherited from Base
Instance Method Summary collapse
- #aggregate_event(key, value) ⇒ Object
- #calculate(key) ⇒ Object
- #summarize(key) ⇒ Object
- #update(_) ⇒ Object
Methods inherited from PulseMeter::Sensor::Timeline
#cleanup, #current_interval_id, #current_raw_data_key, #data_key, #deflate_safe, #drop_within, #event_at, #get_interval_id, #get_raw_value, #initialize, #raw_data_key, #timeline, #timeline_within
Methods included from PulseMeter::Sensor::TimelineReduce
#collect_ids_to_reduce, included, #reduce, #reduce_all_raw
Methods included from Mixins::Utils
#assert_array!, #assert_positive_integer!, #assert_ranged_float!, #camelize, #camelize_keys, #constantize, #each_subset, #parse_time, #subsets_of, #symbolize_keys, #titleize, #uniqid
Methods inherited from Base
#annotate, #annotation, #cleanup, #command_aggregator, #event, #initialize
Methods included from Mixins::Dumper
Constructor Details
This class inherits a constructor from PulseMeter::Sensor::Timeline
Instance Method Details
#aggregate_event(key, value) ⇒ Object
14 15 16 17 |
# File 'lib/pulse-meter/sensor/timelined/zset_based.rb', line 14 def aggregate_event(key, value) command_aggregator.zadd(key, value, "#{value}::#{uniqid}") update(key) end |
#calculate(key) ⇒ Object
10 11 12 |
# File 'lib/pulse-meter/sensor/timelined/zset_based.rb', line 10 def calculate(key) 0 end |
#summarize(key) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/pulse-meter/sensor/timelined/zset_based.rb', line 19 def summarize(key) count = redis.zcard(key) if count > 0 calculate(key, count) else nil end end |
#update(_) ⇒ Object
7 8 |
# File 'lib/pulse-meter/sensor/timelined/zset_based.rb', line 7 def update(_) end |