-
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.
- Loading branch information
1 parent
12c8d2d
commit 8712101
Showing
4 changed files
with
109 additions
and
11 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
36 changes: 36 additions & 0 deletions
36
x-pack/plugins/apm/public/components/shared/Summary/CompositeSpanDurationSummaryItem.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,36 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { EuiToolTip, EuiText } from '@elastic/eui'; | ||
import { asDuration } from '../../../../common/utils/formatters'; | ||
|
||
interface Props { | ||
count: number; | ||
durationSum: number; | ||
} | ||
|
||
function CompositeSpanDurationSummaryItem({ count, durationSum }: Props) { | ||
const avgDuration = durationSum / count; | ||
|
||
const label = i18n.translate('xpack.apm.compositeSpanDurationLabel', { | ||
defaultMessage: 'Average duration', | ||
}); | ||
const callsLabel = i18n.translate('xpack.apm.compositeSpanCallsLabel', { | ||
defaultMessage: 'calls', | ||
}); | ||
return ( | ||
<> | ||
<EuiToolTip content={label}> | ||
<EuiText>{count} {callsLabel}, ∅ {asDuration(avgDuration)}</EuiText> | ||
</EuiToolTip> | ||
</> | ||
); | ||
} | ||
|
||
export { CompositeSpanDurationSummaryItem }; |
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