Skip to content
Merged
Show file tree
Hide file tree
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 Aug 11, 2020
a320a13
update
shahzad31 Aug 11, 2020
1119364
update app
shahzad31 Aug 11, 2020
6eb564f
fix i18n
shahzad31 Aug 11, 2020
e8b68c1
remove space
shahzad31 Aug 11, 2020
6619bcb
Merge branch 'master' into rum-sidebar-link
shahzad31 Aug 11, 2020
e9878e4
added feature on server
shahzad31 Aug 11, 2020
93c5725
use lazy load
shahzad31 Aug 11, 2020
4ff3396
update test
shahzad31 Aug 12, 2020
7e6424f
Merge branch 'master' into rum-sidebar-link
shahzad31 Aug 12, 2020
da8f444
update
shahzad31 Aug 12, 2020
5186fb6
Merge branch 'master' into rum-sidebar-link
shahzad31 Aug 12, 2020
0c2a83c
remove csm serve file
shahzad31 Aug 12, 2020
6a06199
update test
shahzad31 Aug 13, 2020
1c00c84
added design improvements
shahzad31 Aug 13, 2020
b232c8d
WIP
shahzad31 Aug 14, 2020
1de86e6
Merge branch 'master' into rum-sidebar-link
shahzad31 Aug 14, 2020
452c07f
change name to csm
shahzad31 Aug 14, 2020
21d35c1
Merge branch 'master' into rum-core-vitals
shahzad31 Aug 14, 2020
3d1c5e1
update type and use paraalilization in dynmic imports
shahzad31 Aug 14, 2020
a9ab9e5
Merge branch 'rum-sidebar-link' into rum-core-vitals
shahzad31 Aug 14, 2020
8ba65af
update
shahzad31 Aug 15, 2020
5fe4bf6
Merge branch 'master' into rum-sidebar-link
shahzad31 Aug 17, 2020
dad1bc8
rename app
shahzad31 Aug 17, 2020
04eeff7
Merge branch 'master' into rum-core-vitals
shahzad31 Aug 17, 2020
9666a71
update
shahzad31 Aug 17, 2020
c11990e
Merge branch 'master' into rum-sidebar-link
shahzad31 Aug 17, 2020
78fbe89
fix issue with overview page
shahzad31 Aug 17, 2020
452624b
clean up
shahzad31 Aug 17, 2020
548cf11
fix type
shahzad31 Aug 18, 2020
b17c292
Merge branch 'master' into rum-core-vitals
shahzad31 Aug 18, 2020
ca1cee4
Merge branch 'master' into rum-sidebar-link
shahzad31 Aug 19, 2020
e6ea937
remove unused code and translation
shahzad31 Aug 19, 2020
73a0305
Merge branch 'rum-sidebar-link' into rum-core-vitals
shahzad31 Aug 19, 2020
6d43585
update
shahzad31 Aug 20, 2020
8f58df5
Merge branch 'master' into rum-core-vitals
shahzad31 Aug 20, 2020
68bbd3b
update
shahzad31 Aug 20, 2020
9d512be
WIP
shahzad31 Aug 20, 2020
4ab2e3c
Merge branch 'master' into rum-core-vitals
shahzad31 Aug 20, 2020
45b5a1d
Merge branch 'master' into rum-core-vitals
shahzad31 Aug 21, 2020
3af023b
added tooltip
shahzad31 Aug 21, 2020
f236b6a
fix styles
shahzad31 Aug 21, 2020
9502706
update
shahzad31 Aug 21, 2020
637f3c2
Merge branch 'master' into rum-core-vitals
shahzad31 Aug 24, 2020
989f69a
update snapshot
shahzad31 Aug 24, 2020
b292fab
added a story
shahzad31 Aug 24, 2020
5c9bb86
Merge branch 'master' into rum-core-vitals
shahzad31 Sep 2, 2020
68c4bbc
update color for titles
shahzad31 Sep 2, 2020
6f1f369
add tooltip to legend
shahzad31 Sep 2, 2020
ffe41bb
Merge branch 'master' into rum-core-vitals
shahzad31 Sep 2, 2020
d6a9154
Merge branch 'master' into rum-core-vitals
shahzad31 Sep 3, 2020
1b4b8db
fix types
shahzad31 Sep 3, 2020
4ddd702
Merge branch 'rum-core-vitals' of https://github.com/shahzad31/kibana…
shahzad31 Sep 3, 2020
37f086b
Merge branch 'master' into rum-core-vitals
elasticmachine Sep 3, 2020
f77d83d
Merge branch 'master' into rum-core-vitals
elasticmachine Sep 3, 2020
e22a1de
Merge branch 'master' into rum-core-vitals
shahzad31 Sep 4, 2020
8de3347
Merge branch 'rum-core-vitals' of https://github.com/shahzad31/kibana…
shahzad31 Sep 4, 2020
3144c5f
Merge branch 'master' into rum-core-vitals
shahzad31 Sep 4, 2020
ec83da5
PR Feedback
shahzad31 Sep 4, 2020
7a8995e
improve reset zoom button responseiveness
shahzad31 Sep 4, 2020
2d61b21
types fix
shahzad31 Sep 4, 2020
ca0c74b
Merge branch 'master' into rum-core-vitals
shahzad31 Sep 7, 2020
18af0a7
Merge branch 'master' into rum-core-vitals
shahzad31 Sep 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions x-pack/plugins/apm/common/elasticsearch_fieldnames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,9 @@ export const TRANSACTION_TIME_TO_FIRST_BYTE =
'transaction.marks.agent.timeToFirstByte';
export const TRANSACTION_DOM_INTERACTIVE =
'transaction.marks.agent.domInteractive';

export const FCP_FIELD = 'transaction.marks.agent.firstContentfulPaint';
export const LCP_FIELD = 'transaction.marks.agent.largestContentfulPaint';
export const TBT_FIELD = 'transaction.experience.tbt';
export const FID_FIELD = 'transaction.experience.fid';
export const CLS_FIELD = 'transaction.experience.cls';
Comment on lines +110 to +114
Copy link
Member

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?

Copy link
Contributor Author

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.

Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function ClientMetrics() {
<EuiFlexItem grow={false} style={STAT_STYLE}>
<EuiStat
titleSize="s"
title={(data?.frontEnd?.value?.toFixed(2) ?? '-') + ' s'}
title={((data?.frontEnd?.value ?? 0)?.toFixed(2) ?? '-') + ' s'}
description={I18LABELS.frontEnd}
isLoading={status !== 'success'}
/>
Expand Down
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>
);
}
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" />
</>
);
}
Loading