Skip to content

Conversation

@thomasneirynck
Copy link
Contributor

@thomasneirynck thomasneirynck commented Dec 9, 2020

Summary

Closes #78592

Adds the ability to compute a percentile for agg-sources. Can be used for cluster/grid layers and in term joins.

Users can set the percentage explicitly. When set to 50, it computes the median.

image

Internal users of the MapsEmbeddable can add this to their layer-descriptor:

e.g. for a choropleth-map, in the joins-property:

"joins": [
			{
				"leftField": "iso2",
				"right": {
					"type": "ES_TERM_SOURCE",
					"id": "9159a723-72b3-4586-912b-510f844254cc",
					"indexPatternTitle": "kibana_sample_data_logs",
					"term": "geo.dest",
					"metrics": [
						{
							"label": "median",
							"type": "percentile",
							"field": "bytes",
                                                        "percentile": 50
						}
					],
					"applyGlobalQuery": true,
					"applyGlobalTime": true,
					"indexPatternRefName": "layer_2_join_0_index_pattern"
				}
			}
		]

This can then be refered back to by its unique name in the style-descriptors.

e.g. fill-color

	"fillColor": {
					"type": "DYNAMIC",
					"options": {
						"color": "Yellow to Red",
						"colorCategory": "palette_0",
						"field": {
							"origin": "join",
							"name": "__kbnjoin__percentile_of_bytes__9159a723-72b3-4586-912b-510f844254cc_50"
						},
						"fieldMetaOptions": {
							"isEnabled": true,
							"sigma": 3
						},
						"type": "ORDINAL"
					}
				},

Checklist

Delete any items that are not applicable to this PR.

For maintainers

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

I am able to consistently make the features disappear with the following steps

  • Create a new map
  • Add clusters layer
  • Change count aggregation to percentile
  • Slowly move slider to the right trying to set to 90th.
  • At some point, the map stops showing clusters and there are no errors in the console. See the screen shot below. There should be clusters since there is data for the past 24 hours and no filters are applied.

Screen Shot 2020-12-10 at 8 49 46 AM

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

lgtm with a few nits to clean up
code review, tested in chrome

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
maps 657 660 +3

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
maps 2.8MB 2.8MB +7.5KB

Distributable file count

id before after diff
default 47145 47905 +760

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
maps 152.2KB 152.3KB +168.0B

History

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

@thomasneirynck thomasneirynck merged commit 47e2663 into elastic:master Dec 15, 2020
thomasneirynck added a commit to thomasneirynck/kibana that referenced this pull request Dec 15, 2020
thomasneirynck added a commit that referenced this pull request Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:enhancement Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v7.11.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MAP] Map ES_TERM_SOURCE should also allow median(percentiles) value as data source

4 participants