forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UX] Add percentile selector (elastic#78562) (elastic#79058)
- Loading branch information
Showing
41 changed files
with
504 additions
and
242 deletions.
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
Oops, something went wrong.