agoragames / kairos

Python module for time series data in Redis and Mongo
BSD 3-Clause "New" or "Revised" License
207 stars 38 forks source link

Resolve how to handle missed intervals #29

Open awestendorf opened 11 years ago

awestendorf commented 11 years ago

There's a disconnect in how missed intervals are handled in the reading functions. For example, MongoBackend._series does this:

for record in cursor:
  while buckets and buckets[0] < record['interval']:
    rval[ config['i_calc'].from_bucket(buckets.pop(0)) ] = self._type_no_value()

The problem here is that _type_no_value assumes the default type for that timeseries, but when using custom read functions, these filler values don't necessarily match the type that the user-provided functions are assuming.

This would also clear up issues with custom read functions, such as in this case where interval is necessary in the return data, but not strictly necessary to satisfy the goals of the library.