Class: PulseMeter::Sensor::Timelined::UniqCounter
- Inherits:
-
PulseMeter::Sensor::Timeline
- Object
- Base
- PulseMeter::Sensor::Timeline
- PulseMeter::Sensor::Timelined::UniqCounter
- Defined in:
- lib/pulse-meter/sensor/timelined/uniq_counter.rb
Overview
Counts unique events per interval
Constant Summary
Constants inherited from PulseMeter::Sensor::Timeline
PulseMeter::Sensor::Timeline::DEFAULTS
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
Methods inherited from PulseMeter::Sensor::Timeline
#cleanup, #current_interval_id, #current_raw_data_key, #data_key, #event, #get_interval_id, #get_timeline_value, #initialize, #raw_data_key, #reduce, reduce_all_raw, #reduce_all_raw, #timeline, #timeline_within
Methods included from Mixins::Utils
#assert_positive_integer!, #assert_ranged_float!, #camelize, #camelize_keys, #constantize, #symbolize_keys, #titleize, #uniqid
Methods inherited from Base
#annotate, #annotation, #cleanup, #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
6 7 8 |
# File 'lib/pulse-meter/sensor/timelined/uniq_counter.rb', line 6 def aggregate_event(key, value) redis.sadd(key, value) end |
#summarize(key) ⇒ Object
10 11 12 |
# File 'lib/pulse-meter/sensor/timelined/uniq_counter.rb', line 10 def summarize(key) redis.scard(key) end |