-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[RUM Dashboard] Added rum core web vitals #75685
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
Merged
Merged
Changes from all commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
616e31e
craete new path for client side monitoring
shahzad31 a320a13
update
shahzad31 1119364
update app
shahzad31 6eb564f
fix i18n
shahzad31 e8b68c1
remove space
shahzad31 6619bcb
Merge branch 'master' into rum-sidebar-link
shahzad31 e9878e4
added feature on server
shahzad31 93c5725
use lazy load
shahzad31 4ff3396
update test
shahzad31 7e6424f
Merge branch 'master' into rum-sidebar-link
shahzad31 da8f444
update
shahzad31 5186fb6
Merge branch 'master' into rum-sidebar-link
shahzad31 0c2a83c
remove csm serve file
shahzad31 6a06199
update test
shahzad31 1c00c84
added design improvements
shahzad31 b232c8d
WIP
shahzad31 1de86e6
Merge branch 'master' into rum-sidebar-link
shahzad31 452c07f
change name to csm
shahzad31 21d35c1
Merge branch 'master' into rum-core-vitals
shahzad31 3d1c5e1
update type and use paraalilization in dynmic imports
shahzad31 a9ab9e5
Merge branch 'rum-sidebar-link' into rum-core-vitals
shahzad31 8ba65af
update
shahzad31 5fe4bf6
Merge branch 'master' into rum-sidebar-link
shahzad31 dad1bc8
rename app
shahzad31 04eeff7
Merge branch 'master' into rum-core-vitals
shahzad31 9666a71
update
shahzad31 c11990e
Merge branch 'master' into rum-sidebar-link
shahzad31 78fbe89
fix issue with overview page
shahzad31 452624b
clean up
shahzad31 548cf11
fix type
shahzad31 b17c292
Merge branch 'master' into rum-core-vitals
shahzad31 ca1cee4
Merge branch 'master' into rum-sidebar-link
shahzad31 e6ea937
remove unused code and translation
shahzad31 73a0305
Merge branch 'rum-sidebar-link' into rum-core-vitals
shahzad31 6d43585
update
shahzad31 8f58df5
Merge branch 'master' into rum-core-vitals
shahzad31 68bbd3b
update
shahzad31 9d512be
WIP
shahzad31 4ab2e3c
Merge branch 'master' into rum-core-vitals
shahzad31 45b5a1d
Merge branch 'master' into rum-core-vitals
shahzad31 3af023b
added tooltip
shahzad31 f236b6a
fix styles
shahzad31 9502706
update
shahzad31 637f3c2
Merge branch 'master' into rum-core-vitals
shahzad31 989f69a
update snapshot
shahzad31 b292fab
added a story
shahzad31 5c9bb86
Merge branch 'master' into rum-core-vitals
shahzad31 68c4bbc
update color for titles
shahzad31 6f1f369
add tooltip to legend
shahzad31 ffe41bb
Merge branch 'master' into rum-core-vitals
shahzad31 d6a9154
Merge branch 'master' into rum-core-vitals
shahzad31 1b4b8db
fix types
shahzad31 4ddd702
Merge branch 'rum-core-vitals' of https://github.com/shahzad31/kibana…
shahzad31 37f086b
Merge branch 'master' into rum-core-vitals
elasticmachine f77d83d
Merge branch 'master' into rum-core-vitals
elasticmachine e22a1de
Merge branch 'master' into rum-core-vitals
shahzad31 8de3347
Merge branch 'rum-core-vitals' of https://github.com/shahzad31/kibana…
shahzad31 3144c5f
Merge branch 'master' into rum-core-vitals
shahzad31 ec83da5
PR Feedback
shahzad31 7a8995e
improve reset zoom button responseiveness
shahzad31 2d61b21
types fix
shahzad31 ca0c74b
Merge branch 'master' into rum-core-vitals
shahzad31 18af0a7
Merge branch 'master' into rum-core-vitals
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
30 changes: 30 additions & 0 deletions
30
x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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
72 changes: 72 additions & 0 deletions
72
x-pack/plugins/apm/public/components/app/RumDashboard/CoreVitals/ColorPaletteFlexItem.tsx
This file contains hidden or 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,72 @@ | ||
| /* | ||
| * 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 { EuiFlexItem, EuiToolTip } from '@elastic/eui'; | ||
| import styled from 'styled-components'; | ||
|
|
||
| const ColoredSpan = styled.div` | ||
| height: 16px; | ||
| width: 100%; | ||
| cursor: pointer; | ||
| `; | ||
|
|
||
| const getSpanStyle = ( | ||
| position: number, | ||
| inFocus: boolean, | ||
| hexCode: string, | ||
| percentage: number | ||
| ) => { | ||
| let first = position === 0 || percentage === 100; | ||
| let last = position === 2 || percentage === 100; | ||
| if (percentage === 100) { | ||
| first = true; | ||
| last = true; | ||
| } | ||
|
|
||
| const spanStyle: any = { | ||
| backgroundColor: hexCode, | ||
| opacity: !inFocus ? 1 : 0.3, | ||
| }; | ||
| let borderRadius = ''; | ||
|
|
||
| if (first) { | ||
| borderRadius = '4px 0 0 4px'; | ||
| } | ||
| if (last) { | ||
| borderRadius = '0 4px 4px 0'; | ||
| } | ||
| if (first && last) { | ||
| borderRadius = '4px'; | ||
| } | ||
| spanStyle.borderRadius = borderRadius; | ||
|
|
||
| return spanStyle; | ||
| }; | ||
|
|
||
| export function ColorPaletteFlexItem({ | ||
| hexCode, | ||
| inFocus, | ||
| percentage, | ||
| tooltip, | ||
| position, | ||
| }: { | ||
| hexCode: string; | ||
| position: number; | ||
| inFocus: boolean; | ||
| percentage: number; | ||
| tooltip: string; | ||
| }) { | ||
| const spanStyle = getSpanStyle(position, inFocus, hexCode, percentage); | ||
|
|
||
| return ( | ||
| <EuiFlexItem key={hexCode} grow={false} style={{ width: percentage + '%' }}> | ||
| <EuiToolTip content={tooltip}> | ||
| <ColoredSpan style={spanStyle} /> | ||
| </EuiToolTip> | ||
| </EuiFlexItem> | ||
| ); | ||
| } |
124 changes: 124 additions & 0 deletions
124
x-pack/plugins/apm/public/components/app/RumDashboard/CoreVitals/CoreVitalItem.tsx
This file contains hidden or 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,124 @@ | ||
| /* | ||
| * 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 { | ||
| EuiFlexGroup, | ||
| euiPaletteForStatus, | ||
| EuiSpacer, | ||
| EuiStat, | ||
| } from '@elastic/eui'; | ||
| import React, { useState } from 'react'; | ||
| import { i18n } from '@kbn/i18n'; | ||
| import { PaletteLegends } from './PaletteLegends'; | ||
| import { ColorPaletteFlexItem } from './ColorPaletteFlexItem'; | ||
| import { | ||
| AVERAGE_LABEL, | ||
| GOOD_LABEL, | ||
| LESS_LABEL, | ||
| MORE_LABEL, | ||
| POOR_LABEL, | ||
| } from './translations'; | ||
|
|
||
| export interface Thresholds { | ||
| good: string; | ||
| bad: string; | ||
| } | ||
|
|
||
| interface Props { | ||
| title: string; | ||
| value: string; | ||
| ranks?: number[]; | ||
| loading: boolean; | ||
| thresholds: Thresholds; | ||
| } | ||
|
|
||
| export function getCoreVitalTooltipMessage( | ||
| thresholds: Thresholds, | ||
| position: number, | ||
| title: string, | ||
| percentage: number | ||
| ) { | ||
| const good = position === 0; | ||
| const bad = position === 2; | ||
| const average = !good && !bad; | ||
|
|
||
| return i18n.translate('xpack.apm.csm.dashboard.webVitals.palette.tooltip', { | ||
| defaultMessage: | ||
| '{percentage} % of users have {exp} experience because the {title} takes {moreOrLess} than {value}{averageMessage}.', | ||
| values: { | ||
| percentage, | ||
| title: title?.toLowerCase(), | ||
| exp: good ? GOOD_LABEL : bad ? POOR_LABEL : AVERAGE_LABEL, | ||
| moreOrLess: bad || average ? MORE_LABEL : LESS_LABEL, | ||
| value: good || average ? thresholds.good : thresholds.bad, | ||
| averageMessage: average | ||
| ? i18n.translate('xpack.apm.rum.coreVitals.averageMessage', { | ||
| defaultMessage: ' and less than {bad}', | ||
| values: { bad: thresholds.bad }, | ||
| }) | ||
| : '', | ||
| }, | ||
| }); | ||
| } | ||
|
|
||
| export function CoreVitalItem({ | ||
| loading, | ||
| title, | ||
| value, | ||
| thresholds, | ||
| ranks = [100, 0, 0], | ||
| }: Props) { | ||
| const palette = euiPaletteForStatus(3); | ||
|
|
||
| const [inFocusInd, setInFocusInd] = useState<number | null>(null); | ||
|
|
||
| const biggestValIndex = ranks.indexOf(Math.max(...ranks)); | ||
|
|
||
| return ( | ||
| <> | ||
| <EuiStat | ||
| titleSize="s" | ||
| title={value} | ||
| description={title} | ||
| titleColor={palette[biggestValIndex]} | ||
| isLoading={loading} | ||
| /> | ||
| <EuiSpacer size="s" /> | ||
| <EuiFlexGroup | ||
| gutterSize="none" | ||
| alignItems="flexStart" | ||
| style={{ maxWidth: 340 }} | ||
| responsive={false} | ||
| > | ||
| {palette.map((hexCode, ind) => ( | ||
| <ColorPaletteFlexItem | ||
| hexCode={hexCode} | ||
| key={hexCode} | ||
| position={ind} | ||
| inFocus={inFocusInd !== ind && inFocusInd !== null} | ||
| percentage={ranks[ind]} | ||
| tooltip={getCoreVitalTooltipMessage( | ||
| thresholds, | ||
| ind, | ||
| title, | ||
| ranks[ind] | ||
| )} | ||
| /> | ||
| ))} | ||
| </EuiFlexGroup> | ||
| <EuiSpacer size="s" /> | ||
| <PaletteLegends | ||
| ranks={ranks} | ||
| thresholds={thresholds} | ||
| title={title} | ||
| onItemHover={(ind) => { | ||
| setInFocusInd(ind); | ||
| }} | ||
| /> | ||
| <EuiSpacer size="xl" /> | ||
| </> | ||
| ); | ||
| } |
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.
Would it make sense to make a separate file with the csm fields to prepare for the imminent move out of APM?
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.
ok i will do this in a follow up PR.