examples/basic_sensor_data.rb in pulse-meter-0.1.6 vs examples/basic_sensor_data.rb in pulse-meter-0.1.7
- old
+ new
@@ -20,10 +20,16 @@
annotation: 'Rhino Count',
interval: 10,
ttl: 3600
)
+goose_counter = PulseMeter::Sensor::Timelined::HashedCounter.new(:goose_count,
+ annotation: 'Goose Count',
+ interval: 10,
+ ttl: 3600
+)
+
rhino_average_age = PulseMeter::Sensor::Timelined::Average.new(:rhino_average_age,
annotation: 'Rhino average age',
interval: 20,
ttl: 3600
)
@@ -33,6 +39,11 @@
STDERR.puts "tick"
lama_counter.event(1)
rhino_counter.event(2)
lama_average_age.event(Random.rand(50))
rhino_average_age.event(Random.rand(100))
+
+ 10.times do
+ goose_n = Random.rand(4)
+ goose_counter.event("goose_#{goose_n}" => 1)
+ end
end
\ No newline at end of file