Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (28 sloc) 917 Bytes
require 'rubygems'
require 'redis'
require 'redis-timeseries'
# To show the lib implementation here we use a timestep of just one second.
# Then we sample every 0.1 seconds, producing on average 10 samples per key.
# This way we should how multi-key range queries are working.
ts ="test",1,
now =
puts "Adding data points: "
print "#{i} "
sleep 0.1
puts ""
# Get the second in the middle of our sampling.
begin_time = now+1
end_time = now+2
puts "\nGet range from #{begin_time} to #{end_time}"
puts "Record time #{record[:time]}, data #{record[:data]}"
# Show API to get a single timestep
puts "\nGet a single timestep near #{begin_time}"
puts "Record time #{record[:time]}, data #{record[:data]}"
Something went wrong with that request. Please try again.