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

insert() ignores value if count_only = True #10

Closed inactivist closed 11 years ago

inactivist commented 11 years ago

Is this by design?

It would be useful to be able to record multiple 'hits' on a single item by calling Timeseries.insert('item', count) where count > 1 -- web page hits being an example. I might want to record 10 or even 100 hits against a web page in a single .insert call (as an optimization, to reduce communication overhead between the client and Redis.)

Seems like a simple code change, give value a default value of 1 and include the value parameter: pipe.incr(interval_key, value) should do the trick.

awestendorf commented 11 years ago

The mainline is deprecated and this should be a pull request for the beta-refactor branch.

https://github.com/agoragames/kairos/blob/beta-refactor/kairos/timeseries.py#L383

awestendorf commented 11 years ago

Re-opening because this is a feature we want, just not the patch on the old implementation.

inactivist commented 11 years ago

I haven't yet had time to test the beta-refactor branch. I'll work up a pull request for that branch when I do.