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

Allow histogram fields in average and sum aggregations #66891

Merged
merged 2 commits into from
May 19, 2020

Conversation

timroes
Copy link
Contributor

@timroes timroes commented May 18, 2020

Summary

Allow fields of type histogram to be used in sum and average aggregations, since ES added support for it in (Sum: elastic/elasticsearch#55916, Avg: elastic/elasticsearch#56099).

You can see the original PR (#59387) for a list of console commands to get an index with a histogram field in it for testing purposes.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@timroes timroes added release_note:enhancement Feature:Aggregations Aggregation infrastructure (AggConfig, esaggs, ...) Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 v7.9.0 labels May 18, 2020
@timroes timroes requested a review from a team as a code owner May 18, 2020 13:06
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in Firefox and LGTM, left two nits.

});

it('with mean aggregation', async () => {
// Percentile values (which are used by media behind the scenes) are not deterministic,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo media. Also shouldn't the test case be called 'with median aggregation' instead of mean?


it('with percentile ranks aggregation', async () => {
const data = await renderTableForAggregation('Percentile Ranks');
expect(data).to.eql([['0%']]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This test would be more helpful if it would test a different percentile rank than the default 0 - 0% is a typical error value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to ignore this for now, since the the Percentile Ranks has the same non-deterministic problem than the others, so will rather fix that as soon as that's solved.

Copy link
Contributor

@sulemanof sulemanof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested locally. Left some nits.

await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.clickDataTable();
await PageObjects.visualize.clickNewSearch('histogram-test');
await PageObjects.visChart.waitForVisualization();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be an extra wait, should work fine without it since the clickNewSearch is waiting for header.waitUntilLoadingHasFinished();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better save then sorry ;)


const renderTableForAggregation = async (
aggregation: string
): Promise<string[][] | string[][][]> => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra explicit returning type, typed fine from returning return await PageObjects.visChart.getTableVisContent();

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Member

@lukeelmers lukeelmers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes here LGTM, thanks for keeping track of this!

@timroes timroes merged commit 3350bff into elastic:master May 19, 2020
@timroes timroes deleted the feat/histogram-aggs branch May 19, 2020 16:47
timroes pushed a commit to timroes/kibana that referenced this pull request May 20, 2020
* Allow histogram fields in average and sum aggs

* Fix PR review
timroes pushed a commit that referenced this pull request May 20, 2020
* Allow histogram fields in average and sum aggs

* Fix PR review
gmmorris added a commit to gmmorris/kibana that referenced this pull request May 20, 2020
* master: (33 commits)
  [Saved Objects] adds support for including hidden types in saved objects client (elastic#66879)
  [Discover] Deangularize timechart header (elastic#66532)
  [Discover] Improve and unskip a11y context view test (elastic#66959)
  [SIEM] Refactor Timeline.timelineType draft to Timeline.status draft (elastic#66864)
  docs: update RUM documentation link (elastic#67042)
  [QA] fixup coverage ingestion tests. (elastic#66905)
  [Metrics UI] Add support for multiple groupings to Metrics Explorer (and Alerts) (elastic#66503)
  [Metrics UI] Add sorting for name and value to Inventory View (elastic#66644)
  [Metrics UI] Change Metric Threshold Alert charts to use bar charts (elastic#66672)
  [Uptime] Use React.lazy for alert type registration (elastic#66829)
  [Reporting] Consolidate API Integration Test configs (elastic#66637)
  Allow histogram fields in average and sum aggregations (elastic#66891)
  Fix saved object share link (elastic#66771)
  move role reset into the top level after clause (elastic#66971)
  Automate the labels for any PRs affecting files for the Ingest Management team (elastic#67022)
  [SIEMDPOINT] Move endpoint to siem (elastic#66907)
  server.uuid so is not used (elastic#66963)
  Revert "[ci/stats] fix git metadata collection (elastic#66840)"
  [Uptime] Unmount uptime app properly (elastic#66950)
  [Visualize] Bar chart: Show missing values on chart setting (elastic#66375)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Aggregations Aggregation infrastructure (AggConfig, esaggs, ...) release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants