influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

Counter support?

Open iamlaokui opened this issue 12 years ago • 1 comments

Does influxdb support counter? So each time we add a point, We know sum value for this timeseries.

iamlaokui avatar Jan 26 '14 09:01 iamlaokui

There's currently no plan to add something like this in. Your best bet would be to do something like this:

select sum(some_column) from some_series group by time(1d) into some_series.sum.1d

Then you can get the sum on the fly by doing this:

select sum(cache.sum) + sum(some_series.some_column) from some_series.sum.1d as cache, some_series where some_series.time > "2014-01-27:00:00:00"

Where you sub in the time qualifier for whatever the current day is. Or something along those lines.

pauldix avatar Jan 27 '14 15:01 pauldix