Sum, Avg, Min and Max bucket pipeline aggregation#10070
Sum, Avg, Min and Max bucket pipeline aggregation#10070ppisljar merged 10 commits intoelastic:masterfrom
Conversation
7dffa74 to
7322bd0
Compare
7322bd0 to
1eeba3e
Compare
There was a problem hiding this comment.
These names should match how they are being imported. E.g. AggTypesMetricsBucketAvgProvider. This is why I like named exports, it forces you to use consistent naming. :) Here and other bucket_* files
There was a problem hiding this comment.
commented out line (and below)
There was a problem hiding this comment.
The string "Pipeline Aggregations" is repeated in many places. What about creating a metrics_constants file to put it in? Then if we want to change the string we only have to do it in one spot.
There was a problem hiding this comment.
Looks like there is aggGroup and also agg.group and they mean different things. I'm not sure I have a suggestion on the naming, but it'd be nice if they could be distinguished better.
Almost seems like maybe typeName would be more fitting? I think I tracked this down to being used here:
aggTypes.byType[$scope.groupName];
Though that might be too far reaching to change it in this PR since that name already exists and group is the new name.
I think something else that would be worthwhile as a separate PR would be moving metrics and buckets to constants too. That would be easier to understand the importance of these strings and where else they are being referenced. Then you could do something like:
export const AggTypes = {
METRICS: 'metrics',
BUCKETS: 'buckets'
}
Food for thought mostly, I understand if you prefer to leave as is for lack of a better alternative at this point.
There was a problem hiding this comment.
i renamed agg.group to agg.subtype
There was a problem hiding this comment.
Is this used at all? I'm a little confused at the interaction and differences between rejectAgg and the aggFilter. Since the aggFilter already contains all these, if I select for example Top Hits, I don't see any of the sibling drop downs.
There was a problem hiding this comment.
you are right, this is not used here great find!... to much copy pasting from parent pipeline agg :)
|
@stacey-gammon the reason for error was sorting on bucket metric in your terms bucket. i updated it so its not allowed anymore. i also addressed your other comments. thanks a lot for your super fast response ! |
906c227 to
b3bf1fb
Compare
|
@ppisljar A couple of quick comments:
|
|
@ppisljar A couple of other problems I ran into... Do we allow pipeline agg of a pipeline or should that be disabled in the vis editor? |
|
@tanya seems i forgot to push some things .... i'll fix this tomorrow |
|
i updated and rebased ....
|
thomasneirynck
left a comment
There was a problem hiding this comment.
Don't have much to say about this one, given the incremental addition.
The metric-selection UI is getting top-heavy, so I would consider a few simplifications.
-
I would consider splitting parent/sibling into their own category in the selector. Not only to give some texture to the list in the dropdown, but also prime the user that metrics-selector are different for each (siblings allow a full bucket selections, while bucket aggregations only allows to select metrics).
-
we should consider hiding the "Custom metric" dropdown for parent aggregations, since there is only a single option.
There was a problem hiding this comment.
resolve merge conflict
7be517b to
47b7be7
Compare
|
thanks @thomasneirynck
|
|
jenkins, test this |
|
@stacey-gammon That's because of the nature of the bucket sum, in that particular configuration. It does an overall sum of the counts, which is identical for all those fields (given that the same docs are included in all those buckets-by-date). choose a metric other than count, and then you will see different results (e.g. min of bytes, ...) |
thomasneirynck
left a comment
There was a problem hiding this comment.
For me, it's good!
FWIW, while playing around, I triggered an uncaught error. But I can no longer reproduce this, I forget the exact steps. Perhaps this is familiar?
:5601/xye/bundles/commons.bundle.js?v=8467:34823 TypeError: Cannot read property 'displayName' of undefined
at MetricAggType.makeLabel (https://localhost:5601/xye/bundles/kibana.bundle.js?v=8467:119764:52)
at AggConfigFactory.AggConfig.makeLabel (https://localhost:5601/xye/bundles/kibana.bundle.js?v=8467:120597:30)
at https://localhost:5601/xye/bundles/kibana.bundle.js?v=8467:158117:38
at Array.map (native)
at Object.fn (https://localhost:5601/xye/bundles/kibana.bundle.js?v=8467:158114:51)
at Scope.$digest (https://localhost:5601/xye/bundles/commons.bundle.js?v=8467:38172:30)
at Scope.$apply (https://localhost:5601/xye/bundles/commons.bundle.js?v=8467:38443:25)
at HTMLSelectElement.<anonymous> (https://localhost:5601/xye/bundles/commons.bundle.js?v=8467:50871:16)
at HTMLSelectElement.dispatch (https://localhost:5601/xye/bundles/commons.bundle.js?v=8467:17466:10)
at HTMLSelectElement.elemData.handle (https://localhost:5601/xye/bundles/commons.bundle.js?v=8467:17152:29)
47b7be7 to
eb2c7ba
Compare
eb2c7ba to
5848c74
Compare
stacey-gammon
left a comment
There was a problem hiding this comment.
I'd like to see some selenium tests for some of the bugs encountered along the way, but understanding our limited time availability, LGTM.
|
future improvements: #10633 |
Backports PR #10070 **Commit 1:** allow parent aggs to have sub aggs defined * Original sha: c8484e4 * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-02-06T15:47:33Z **Commit 2:** adding bucket_sum aggregation * Original sha: aea3cbf * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-02-06T16:12:36Z **Commit 3:** adding bucket_avg, bucket_min and bucket_max * Original sha: 7602ee1 * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-02-07T08:49:58Z **Commit 4:** fixing based on UI review * Original sha: 8af734c * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-02-15T11:57:40Z **Commit 5:** adding tests * Original sha: 690dc6b * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-02-15T12:21:28Z **Commit 6:** disable terms sorting on pipeline aggs * Original sha: 7e3a32c * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-02-16T09:11:54Z **Commit 7:** fixing based on Staceys review * Original sha: ad8b5b5 * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-02-16T09:12:18Z **Commit 8:** adding defaults * Original sha: 0fb1d93 * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-02-22T10:40:09Z **Commit 9:** updated based on review * Original sha: cc6c703 * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-02-28T09:40:21Z **Commit 10:** fixing error with stacking * Original sha: 5848c74 * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-03-01T14:17:28Z
Backports PR #10070 **Commit 1:** allow parent aggs to have sub aggs defined * Original sha: c8484e4 * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-02-06T15:47:33Z **Commit 2:** adding bucket_sum aggregation * Original sha: aea3cbf * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-02-06T16:12:36Z **Commit 3:** adding bucket_avg, bucket_min and bucket_max * Original sha: 7602ee1 * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-02-07T08:49:58Z **Commit 4:** fixing based on UI review * Original sha: 8af734c * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-02-15T11:57:40Z **Commit 5:** adding tests * Original sha: 690dc6b * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-02-15T12:21:28Z **Commit 6:** disable terms sorting on pipeline aggs * Original sha: 7e3a32c * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-02-16T09:11:54Z **Commit 7:** fixing based on Staceys review * Original sha: ad8b5b5 * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-02-16T09:12:18Z **Commit 8:** adding defaults * Original sha: 0fb1d93 * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-02-22T10:40:09Z **Commit 9:** updated based on review * Original sha: cc6c703 * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-02-28T09:40:21Z **Commit 10:** fixing error with stacking * Original sha: 5848c74 * Authored by ppisljar <peter.pisljar@gmail.com> on 2017-03-01T14:17:28Z
|
@ppisljar Can you add a detailed description (with screenshots) of these features to this PR description? Whenever we make any progress on pipeline aggs, please also drop a comment on the pipeline agg ticket since a lot of people want to know about this. |
* allow parent aggs to have sub aggs defined * adding bucket_sum aggregation * adding bucket_avg, bucket_min and bucket_max * fixing based on UI review * adding tests * disable terms sorting on pipeline aggs * fixing based on Staceys review * adding defaults * updated based on review * fixing error with stacking











adds bucket_sum , bucket_avg, bucket_min and bucket_max sibling pipeline aggregations