-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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 new rate aggregation #60674
Comments
Pinging @elastic/es-analytics-geo (:Analytics/Aggregations) |
I'm not sure that it's a good idea to combine this function, which is the "average event rate", and the other function "positive rate". The main reason is that the "event rate" calculation is much simpler. |
The date histogram can support fixed, calendar and legacy intervals. These interval need to work with the rate calculator used by the rate aggregation. In order to remove ambiguity I would like to propose the following limitations:
|
Will this support histogram fields as well? ie, will it use |
Just wanted to add that we do various manual rate calculations in APM and we also have a manual implementation of a monotonically increasing counter for our garbage collection charts. We combine a |
I was thinking to use count by default if the
We decided to handle monotonically increasing counters as a separate aggregation, which is tracked by #60619. Could you take a look and comment on this issue if you see some functionality that is currently missing? |
@imotov To clarify, considering the following document type: {
"@timestamp": {
"type": "date"
},
"duration": {
"type": "histogram"
}
} I would like to be able to use a
And have the rate based on the count of values stored in the histogram field |
@dgieselaar in that scenario, I'm assuming it'd be the total sum of the histo counts in that bucket?
In this case, the total count would be (1+2+3+4+5+6+7)==28 for the two histos, and so the rate would be 28/hr in that bucket. Is that what you'd expect to happen, or something else? |
@polyfractal that's right, I should have said sum of counts, not count of values. Thanks for catching that 😃 |
👍 awesome, sounds good. I started to type out one thing and then confused myself... so figured it'd be good to make sure we were talking about the same thing :) I'll defer to Igor whose much more deeper in the weeds working on this than me, but that doesn't sound like it would be impossible to implement. Might end up being a separate PR just to keep things simple though since the histo implementation is a little different from other fields. But |
I think the original plan was to add all values, the way Zach described it. |
Adds a new rate aggregation that can calculate a document rate for buckets of a date_histogram. Closes #60674
In the initial implementation I missed the the test to check if bucket sorting works correctly. This commit adds this test. Relates to elastic#60674
In the initial implementation I missed the the test to check if bucket sorting works correctly. This commit adds this test. Relates to #60674
In the initial implementation I missed the the test to check if bucket sorting works correctly. This commit adds this test. Relates to elastic#60674
In the initial implementation I missed the the test to check if bucket sorting works correctly. This commit adds this test. Relates to #60674
We have received several requests to add "rate" functionality or aggregation: how many docs/s were there per bucket in a date_histogram? We have decided to implement this as a special metric aggregation with a scope limited to only
date_histogram
aggregation at the moment, in other words, therate
aggregation will have to be a descendant of adate_histgram
and in the case of nested histograms the closest ancestor will be used to determine the rate.By default the number of documents in the bucket will be used to calculate the rate, but it will be also possible to specify a numeric field to use sum of all values of the field to calculate the rate:
We could also add support for
"accumulative" : true
flag to address #60619 in a future iteration.The text was updated successfully, but these errors were encountered: