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

Wire up DIFFERENCE aggregate #1825

Closed
pauldix opened this issue Mar 3, 2015 · 16 comments · Fixed by #6105
Closed

Wire up DIFFERENCE aggregate #1825

pauldix opened this issue Mar 3, 2015 · 16 comments · Fixed by #6105
Assignees
Labels
area/functions difficulty/medium Resolving this issue should take up to a week kind/feature-request
Milestone

Comments

@pauldix
Copy link
Member

pauldix commented Mar 3, 2015

If the query is like this:

SELECT DIFFERENCE(value)
FROM cpu
WHERE time > now() - 4h

It will return a series with the difference between each value.

If the query is like this:

SELECT DIFFERENCE(MIN(value))
FROM cpu
WHERE time > now() - 4h
GROUP BY time(5m)

It will return the difference of the min value for each 5 minute window of time.

@Gibheer
Copy link

Gibheer commented Aug 4, 2015

From tsdb/executor.go#L443 this seems to be implemented now, is that correct?

@jchauncey
Copy link

Any news on when this might come?

@Vebryn
Copy link

Vebryn commented Oct 13, 2015

I don't see this issue on 9.5 changelog https://github.com/influxdb/influxdb/blob/master/CHANGELOG.md

@beckettsean
Copy link
Contributor

@Vebryn it hasn't been completed, so it is not on the CHANGELOG.

@Vebryn
Copy link

Vebryn commented Oct 13, 2015

Ok, thank you, let's wait and see

@superdump
Copy link

Looking forward to this.

@corylanou
Copy link
Contributor

The query engine is undergoing heavy refactoring. Removing help wanted label for now.

@pauldix pauldix removed this from the 0.9.5 milestone Dec 8, 2015
@marcinpraczko
Copy link

Hi, Are there any ETA for this when it will be released?
Or what is other way of displaying bandwidth usage? We know that linux increases this number over and over: /sys/class/net/eth0/statistics/rx_bytes, so is there any way to do difference on InfluxDB level, or so far I have to do that differently by "collector"?

@pauldix
Copy link
Member Author

pauldix commented Dec 9, 2015

What about non_negative_derivative?

@tothandor
Copy link

Could you please add a shorter alias for this function, like "diff" or "delta" instead of "non_negative_derivative"!

@jazdw
Copy link

jazdw commented Dec 21, 2015

Is there currently anyway to define different grouping functions for time and between series? So we can do mean_series(last("value") - first("value")).

@beckettsean
Copy link
Contributor

@jazdw no, there are no composite functions yet. That specific case is an interesting feature request, can you open a new issue to track it?

@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.

@jsternberg
Copy link
Contributor

I'm beginning to work on this.

@jsternberg jsternberg reopened this Mar 23, 2016
@jsternberg jsternberg self-assigned this Mar 23, 2016
@jsternberg jsternberg added this to the 0.12.0 milestone Mar 23, 2016
jsternberg added a commit that referenced this issue Mar 23, 2016
The difference function is implemented very similar to how derivative is
implemented. It is an aggregate function that acts over the entire
aggregate. This function will also have the same problems that
derivative has with getting values from the previous interval or point.
This will be fixed separately as part of #5943.

Fixes #1825.
jsternberg added a commit that referenced this issue Mar 24, 2016
The difference function is implemented very similar to how derivative is
implemented. It is an aggregate function that acts over the entire
aggregate. This function will also have the same problems that
derivative has with getting values from the previous interval or point.
This will be fixed separately as part of #5943.

Fixes #1825.
jsternberg added a commit that referenced this issue Mar 25, 2016
The difference function is implemented very similar to how derivative is
implemented. It is an aggregate function that acts over the entire
aggregate. This function will also have the same problems that
derivative has with getting values from the previous interval or point.
This will be fixed separately as part of #5943.

Fixes #1825.
jsternberg added a commit that referenced this issue Mar 28, 2016
The difference function is implemented very similar to how derivative is
implemented. It is an aggregate function that acts over the entire
aggregate. This function will also have the same problems that
derivative has with getting values from the previous interval or point.
This will be fixed separately as part of #5943.

Fixes #1825.
jsternberg added a commit that referenced this issue Mar 29, 2016
The difference function is implemented very similar to how derivative is
implemented. It is an aggregate function that acts over the entire
aggregate. This function will also have the same problems that
derivative has with getting values from the previous interval or point.
This will be fixed separately as part of #5943.

Fixes #1825.
@alcroito
Copy link

alcroito commented Apr 2, 2018

I know this is an old closed issue, but it still pops up when googling.
As requested by some previous commenters, the solution for computing bandwidth usage for a specific time period (or disk usage increase / decrease) is described in the final comments of #7076 and involves the usage of difference and cumulative_sum.

mark-rushakoff pushed a commit that referenced this issue Jan 11, 2019
…ttons-selection-step

Data loader/remove sidebar buttons selection step
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/functions difficulty/medium Resolving this issue should take up to a week kind/feature-request
Projects
None yet
Development

Successfully merging a pull request may close this issue.