-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* [RUM Dashboard] Chart breakdowns (#69420) Co-authored-by: Casper Hübertz <[email protected]> Co-authored-by: Elastic Machine <[email protected]> * added timout for cypress get Co-authored-by: Casper Hübertz <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
f7fe5f2
commit b352a3b
Showing
32 changed files
with
1,142 additions
and
324 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
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
31 changes: 31 additions & 0 deletions
31
x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum/page_load_dist.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,31 @@ | ||
/* | ||
* 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 { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'; | ||
|
||
/** The default time in ms to wait for a Cypress command to complete */ | ||
export const DEFAULT_TIMEOUT = 60 * 1000; | ||
|
||
Given(`a user click page load breakdown filter`, () => { | ||
// wait for all loading to finish | ||
cy.get('kbnLoadingIndicator').should('not.be.visible'); | ||
cy.get('.euiStat__title-isLoading').should('not.be.visible'); | ||
const breakDownBtn = cy.get('[data-cy=breakdown-popover_pageLoad]'); | ||
breakDownBtn.click(); | ||
}); | ||
|
||
When(`the user selected the breakdown`, () => { | ||
cy.get('[data-cy=filter-breakdown-item_Browser]').click(); | ||
// click outside popover to close it | ||
cy.get('[data-cy=pageLoadDist]').click(); | ||
}); | ||
|
||
Then(`breakdown series should appear in chart`, () => { | ||
cy.get('.euiLoadingChart').should('not.be.visible'); | ||
cy.get('div.echLegendItem__label[title=Chrome] ') | ||
.invoke('text') | ||
.should('eq', 'Chrome'); | ||
}); |
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
43 changes: 43 additions & 0 deletions
43
x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum/rum_filters.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,43 @@ | ||
/* | ||
* 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 { DEFAULT_TIMEOUT } from '../apm'; | ||
|
||
When(/^the user filters by "([^"]*)"$/, (filterName) => { | ||
// wait for all loading to finish | ||
cy.get('kbnLoadingIndicator').should('not.be.visible'); | ||
cy.get('.euiStat__title-isLoading').should('not.be.visible'); | ||
cy.get(`#local-filter-${filterName}`).click(); | ||
|
||
if (filterName === 'os') { | ||
cy.get('button.euiSelectableListItem[title="Mac OS X"]', { | ||
timeout: DEFAULT_TIMEOUT, | ||
}).click(); | ||
} else { | ||
cy.get('button.euiSelectableListItem[title="DE"]', { | ||
timeout: DEFAULT_TIMEOUT, | ||
}).click(); | ||
} | ||
cy.get('[data-cy=applyFilter]').click(); | ||
}); | ||
|
||
Then(`it filters the client metrics`, () => { | ||
const clientMetrics = '[data-cy=client-metrics] .euiStat__title'; | ||
|
||
// wait for all loading to finish | ||
cy.get('kbnLoadingIndicator').should('not.be.visible'); | ||
cy.get('.euiStat__title-isLoading').should('not.be.visible'); | ||
|
||
cy.get(clientMetrics).eq(2).invoke('text').snapshot(); | ||
|
||
cy.get(clientMetrics).eq(1).invoke('text').snapshot(); | ||
|
||
cy.get(clientMetrics).eq(0).invoke('text').snapshot(); | ||
|
||
cy.get('[data-cy=clearFilters]').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
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,19 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
const IPS = [ | ||
'89.191.86.214', // check24.de | ||
'167.40.79.24', // canada.ca | ||
'151.101.130.217', // elastic.co | ||
'185.143.68.17', | ||
'151.101.130.217', | ||
'185.143.68.17', | ||
'185.143.68.17', | ||
'151.101.130.217', | ||
'185.143.68.17', | ||
]; | ||
|
||
module.exports = IPS; |
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,23 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/* eslint-disable no-console */ | ||
|
||
/* eslint-disable import/no-extraneous-dependencies */ | ||
|
||
const UserAgents = [ | ||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36', | ||
'Mozilla/5.0 (Linux; Android 8.0.0; SM-G960F Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36', | ||
'Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/69.0.3497.105 Mobile/15E148 Safari/605.1', | ||
'Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1', | ||
'Mozilla/5.0 (Linux; Android 7.0; Pixel C Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.98 Safari/537.36', | ||
'Mozilla/5.0 (X11; CrOS x86_64 8172.45.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.64 Safari/537.36', | ||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9', | ||
'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1', | ||
'Mozilla/5.0 (CrKey armv7l 1.5.16041) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.0 Safari/537.36', | ||
]; | ||
|
||
module.exports = UserAgents; |
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
68 changes: 68 additions & 0 deletions
68
x-pack/plugins/apm/public/components/app/RumDashboard/Breakdowns/BreakdownFilter.tsx
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,68 @@ | ||
/* | ||
* 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 React from 'react'; | ||
import { BreakdownGroup } from './BreakdownGroup'; | ||
import { BreakdownItem } from '../../../../../typings/ui_filters'; | ||
import { | ||
CLIENT_GEO_COUNTRY_ISO_CODE, | ||
USER_AGENT_DEVICE, | ||
USER_AGENT_NAME, | ||
USER_AGENT_OS, | ||
} from '../../../../../common/elasticsearch_fieldnames'; | ||
|
||
interface Props { | ||
id: string; | ||
selectedBreakdowns: BreakdownItem[]; | ||
onBreakdownChange: (values: BreakdownItem[]) => void; | ||
} | ||
|
||
export const BreakdownFilter = ({ | ||
id, | ||
selectedBreakdowns, | ||
onBreakdownChange, | ||
}: Props) => { | ||
const categories: BreakdownItem[] = [ | ||
{ | ||
name: 'Browser', | ||
type: 'category', | ||
count: 0, | ||
selected: selectedBreakdowns.some(({ name }) => name === 'Browser'), | ||
fieldName: USER_AGENT_NAME, | ||
}, | ||
{ | ||
name: 'OS', | ||
type: 'category', | ||
count: 0, | ||
selected: selectedBreakdowns.some(({ name }) => name === 'OS'), | ||
fieldName: USER_AGENT_OS, | ||
}, | ||
{ | ||
name: 'Device', | ||
type: 'category', | ||
count: 0, | ||
selected: selectedBreakdowns.some(({ name }) => name === 'Device'), | ||
fieldName: USER_AGENT_DEVICE, | ||
}, | ||
{ | ||
name: 'Location', | ||
type: 'category', | ||
count: 0, | ||
selected: selectedBreakdowns.some(({ name }) => name === 'Location'), | ||
fieldName: CLIENT_GEO_COUNTRY_ISO_CODE, | ||
}, | ||
]; | ||
|
||
return ( | ||
<BreakdownGroup | ||
id={id} | ||
items={categories} | ||
onChange={(selValues: BreakdownItem[]) => { | ||
onBreakdownChange(selValues); | ||
}} | ||
/> | ||
); | ||
}; |
Oops, something went wrong.