Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for cumulative counts #813

Closed
pauldix opened this issue Aug 11, 2014 · 7 comments
Closed

Add support for cumulative counts #813

pauldix opened this issue Aug 11, 2014 · 7 comments
Labels
Milestone

Comments

@pauldix
Copy link
Member

pauldix commented Aug 11, 2014

We should have an aggregate function that will return cumulative counts. For example, say we're grouping by 5m. The first 5m has 2 points, the second 5m has 1, and the last 5m has 3. A query like this:

select count(value) from events group by time(5m)

Would produce three points with values 2, 1, and 3. The cumulative output should produce three points with values 2, 3, and 6.

The tricky part is that most people want this type of cumulative function on the output of continuous queries. So they would have to handle reading the last cumulative value from the continuous query output instead of having it from what was computed before.

@pauldix
Copy link
Member Author

pauldix commented Aug 11, 2014

There is a discussion on this here: https://groups.google.com/forum/#!msg/influxdb/qU-_hi-8FwI/xfbkx40oEGgJ

@toddboom toddboom changed the title Add support for cumulative couns Add support for cumulative counts Oct 23, 2014
@toddboom toddboom added idea and removed idea labels Oct 23, 2014
@rtuin
Copy link

rtuin commented Apr 11, 2015

I'm new to influxdb and a way to count the cumulative of values would be very useful.
Can someone point me to more info on these continuous queries mentioned above? I think I'm looking in the wrong places for it.

@beckettsean
Copy link
Contributor

@rtuin continuous queries are partially documented here: http://influxdb.com/docs/v0.9/concepts/continuous_queries.html but the docs are already out of date (see #2267). Right now there are no cumulative counts built into the query engine. Continuous queries are a great use case for cumulative counts, but they are not a good way to create cumulative counts.

@beckettsean beckettsean removed the idea label Apr 21, 2015
@beckettsean beckettsean added this to the Next Point Release milestone May 5, 2015
@beckettsean beckettsean added area/queries status/help-wanted difficulty/medium Resolving this issue should take up to a week labels May 5, 2015
@beckettsean beckettsean modified the milestones: Next Point Release, Longer term Aug 6, 2015
@e-dard
Copy link
Contributor

e-dard commented Nov 13, 2015

ping @corylanou - is this one to remove help-wanted while waiting on the engine refactor?

@corylanou
Copy link
Contributor

Removing help wanted tag while query engine is going through refactoring.

@beckettsean
Copy link
Contributor

As mentioned in my post to the mailing list we are experimenting with simplifying our open GitHub Issues. This feature request has been rolled into an aggregate issue for all function requests, so that we can close this issue until we are ready to work on it.

You may continue to make comments here. Closing the issue does not mean we are rejecting this idea.

@jwilder
Copy link
Contributor

jwilder commented Oct 13, 2016

This may be fixed now via #7388

Something like select cumulative_sum(count(value)) from events ... group by time(5m) might work.

jsternberg added a commit that referenced this issue May 18, 2017
The test cases demonstrate that the following issues are resolved
through some newer features.

Related to #813, #5095, #2467, #5345, and #5150.
stuartcarnie pushed a commit that referenced this issue May 25, 2017
The test cases demonstrate that the following issues are resolved
through some newer features.

Related to #813, #5095, #2467, #5345, and #5150.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants