lib/pulse_meter/sensor/timeline.rb
# Returts sensor data within given time
# @param from [Time] lower bound
# @param till [Time] upper bound
# @param skip_optimization [Boolean] must be set to true to skip interval optimization
# @return [Array<SensorData>]
# @raise ArgumentError if argumets are not valid time objects
Returts sensor data within given time
Returts sensor data within given time
def timeline_within(from, till, skip_optimization = false)
        raise ArgumentError unless from.kind_of?(Time) && till.kind_of?(Time)
        start_time, end_time = time_to_redis(from.to_i), time_to_redis(till.to_i)
        actual_interval = optimized_interval(start_time, end_time, skip_optimization)
        start_interval_id = get_interval_id(start_time) + actual_interval
        ids, values = fetch_reduced_interval_data(start_interval_id, actual_interval, end_time)
        zip_with_raw_data(ids, values)
      end
def timeline_within ( from , till , skip_optimization = false ) raise ArgumentError unless from . kind_of? ( Time ) && till . kind_of? ( Time ) start_time , end_time = time_to_redis ( from . to_i ) , time_to_redis ( till . to_i ) actual_interval = optimized_interval ( start_time , end_time , skip_optimization ) start_interval_id = get_interval_id ( start_time ) + actual_interval ids , values = fetch_reduced_interval_data ( start_interval_id , actual_interval , end_time ) zip_with_raw_data ( ids , values ) end
Returts sensor data within given time
Returts sensor data within given time
None
Array<SensorData>
ArgumentError if argumets are not valid time objects
ArgumentError if argumets are not valid time objects
from
None
till
None
skip_optimization
must be set to true to skip interval optimization
must be set to true to skip interval optimization