-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[UX] Add percentile selector #78562
Merged
Merged
[UX] Add percentile selector #78562
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c3c95e4
WIP
shahzad31 549882e
WIP
shahzad31 672e21c
Merge branch 'master' into add-median-filter
shahzad31 1b8f4db
update filter
shahzad31 15b9488
update filter
shahzad31 dd15741
update telemetry
shahzad31 d69141c
fix types
shahzad31 6b7cd05
fix types
shahzad31 32ab9b2
revert unnecessary changes
shahzad31 732a0c9
Merge branch 'master' into add-median-filter
shahzad31 b2ab654
fix type
shahzad31 0d36032
Merge branch 'master' into add-median-filter
shahzad31 527640f
update test
shahzad31 93f5185
added a test for percentile
shahzad31 ca5dfd4
Merge branch 'master' into add-median-filter
shahzad31 9798c6e
Merge branch 'master' into add-median-filter
shahzad31 1db04fb
update legend
shahzad31 9f4e57f
PR feedback
shahzad31 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
import { | ||
AGENT_NAME, | ||
CLIENT_GEO_COUNTRY_ISO_CODE, | ||
CONTAINER_ID, | ||
HOST_NAME, | ||
POD_NAME, | ||
SERVICE_NAME, | ||
SERVICE_VERSION, | ||
TRANSACTION_RESULT, | ||
TRANSACTION_URL, | ||
USER_AGENT_DEVICE, | ||
USER_AGENT_NAME, | ||
USER_AGENT_OS, | ||
} from './elasticsearch_fieldnames'; | ||
|
||
export const filtersByName = { | ||
host: { | ||
title: i18n.translate('xpack.apm.localFilters.titles.host', { | ||
defaultMessage: 'Host', | ||
}), | ||
fieldName: HOST_NAME, | ||
}, | ||
agentName: { | ||
title: i18n.translate('xpack.apm.localFilters.titles.agentName', { | ||
defaultMessage: 'Agent name', | ||
}), | ||
fieldName: AGENT_NAME, | ||
}, | ||
containerId: { | ||
title: i18n.translate('xpack.apm.localFilters.titles.containerId', { | ||
defaultMessage: 'Container ID', | ||
}), | ||
fieldName: CONTAINER_ID, | ||
}, | ||
podName: { | ||
title: i18n.translate('xpack.apm.localFilters.titles.podName', { | ||
defaultMessage: 'Kubernetes pod', | ||
}), | ||
fieldName: POD_NAME, | ||
}, | ||
transactionResult: { | ||
title: i18n.translate('xpack.apm.localFilters.titles.transactionResult', { | ||
defaultMessage: 'Transaction result', | ||
}), | ||
fieldName: TRANSACTION_RESULT, | ||
}, | ||
serviceVersion: { | ||
title: i18n.translate('xpack.apm.localFilters.titles.serviceVersion', { | ||
defaultMessage: 'Service version', | ||
}), | ||
fieldName: SERVICE_VERSION, | ||
}, | ||
transactionUrl: { | ||
title: i18n.translate('xpack.apm.localFilters.titles.transactionUrl', { | ||
defaultMessage: 'Url', | ||
}), | ||
fieldName: TRANSACTION_URL, | ||
}, | ||
browser: { | ||
title: i18n.translate('xpack.apm.localFilters.titles.browser', { | ||
defaultMessage: 'Browser', | ||
}), | ||
fieldName: USER_AGENT_NAME, | ||
}, | ||
device: { | ||
title: i18n.translate('xpack.apm.localFilters.titles.device', { | ||
defaultMessage: 'Device', | ||
}), | ||
fieldName: USER_AGENT_DEVICE, | ||
}, | ||
location: { | ||
title: i18n.translate('xpack.apm.localFilters.titles.location', { | ||
defaultMessage: 'Location', | ||
}), | ||
fieldName: CLIENT_GEO_COUNTRY_ISO_CODE, | ||
}, | ||
os: { | ||
title: i18n.translate('xpack.apm.localFilters.titles.os', { | ||
defaultMessage: 'OS', | ||
}), | ||
fieldName: USER_AGENT_OS, | ||
}, | ||
serviceName: { | ||
title: i18n.translate('xpack.apm.localFilters.titles.serviceName', { | ||
defaultMessage: 'Service name', | ||
}), | ||
fieldName: SERVICE_NAME, | ||
}, | ||
}; | ||
|
||
export type LocalUIFilterName = keyof typeof filtersByName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/percentile_select.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { When, Then } from 'cypress-cucumber-preprocessor/steps'; | ||
import { verifyClientMetrics } from './client_metrics_helper'; | ||
import { getDataTestSubj } from './utils'; | ||
|
||
When('the user changes the selected percentile', () => { | ||
// wait for all loading to finish | ||
cy.get('kbnLoadingIndicator').should('not.be.visible'); | ||
|
||
getDataTestSubj('uxPercentileSelect').click(); | ||
|
||
getDataTestSubj('p95Percentile').click(); | ||
}); | ||
|
||
Then(`it displays client metric related to that percentile`, () => { | ||
const metrics = ['14 ms', '0.13 s', '55 ']; | ||
|
||
verifyClientMetrics(metrics, false); | ||
|
||
// reset to median | ||
getDataTestSubj('uxPercentileSelect').click(); | ||
|
||
getDataTestSubj('p50Percentile').click(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/utils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { DEFAULT_TIMEOUT } from './csm_dashboard'; | ||
|
||
export function getDataTestSubj(dataTestSubj: string) { | ||
// wait for all loading to finish | ||
cy.get('kbnLoadingIndicator').should('not.be.visible'); | ||
|
||
return cy.get(`[data-test-subj=${dataTestSubj}]`, DEFAULT_TIMEOUT); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest aligning the percentile selector by the date picker. This is a global selector like the time range, so it feels more natural to place adjacent to that option.
cc @drewpost @katrin-freihofner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could choose to add a prepended label in front of the selector which displays "Aggregation" or "Agg." shortened.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be nice to indicate that this is "active" when it isn't set to the default value of
P50
. This value gets persisted in the URL so someone could get linked to this state and be unaware.