[8.10] [Profiling] removing ~ symbol (#164595) (#164680)

# Backport

This will backport the following commits from `main` to `8.10`:
- [[Profiling] removing ~ symbol
(#164595)](https://github.com/elastic/kibana/pull/164595)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Cauê
Marcondes","email":"55978943+cauemarcondes@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-08-24T10:15:32Z","message":"[Profiling]
removing ~ symbol (#164595)\n\nBefore:\r\n![Screenshot 2023-08-23 at 15
03\r\n38](cd18f0a4-54b9-4dc6-a7d3-780189bf8e30)\r\n\r\nAfter\r\n![Screenshot
2023-08-23 at 15
04\r\n11](bb8bbbec-ee35-446e-8ec8-865fe9d1b831)","sha":"ad55946c1275d4ce2bd8cc453580acf73bbc17bf","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v8.10.0","v8.11.0"],"number":164595,"url":"https://github.com/elastic/kibana/pull/164595","mergeCommit":{"message":"[Profiling]
removing ~ symbol (#164595)\n\nBefore:\r\n![Screenshot 2023-08-23 at 15
03\r\n38](cd18f0a4-54b9-4dc6-a7d3-780189bf8e30)\r\n\r\nAfter\r\n![Screenshot
2023-08-23 at 15
04\r\n11](bb8bbbec-ee35-446e-8ec8-865fe9d1b831)","sha":"ad55946c1275d4ce2bd8cc453580acf73bbc17bf"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164595","number":164595,"mergeCommit":{"message":"[Profiling]
removing ~ symbol (#164595)\n\nBefore:\r\n![Screenshot 2023-08-23 at 15
03\r\n38](cd18f0a4-54b9-4dc6-a7d3-780189bf8e30)\r\n\r\nAfter\r\n![Screenshot
2023-08-23 at 15
04\r\n11](bb8bbbec-ee35-446e-8ec8-865fe9d1b831)","sha":"ad55946c1275d4ce2bd8cc453580acf73bbc17bf"}}]}]
BACKPORT-->

Co-authored-by: Cauê Marcondes <55978943+cauemarcondes@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2023-08-24 07:31:15 -04:00 committed by GitHub
parent b8f9d4a8e6
commit 9f91b8dd8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 2 additions and 21 deletions

View file

@ -38,7 +38,6 @@ interface Props {
comparisonCountExclusive?: number;
comparisonTotalSamples?: number;
comparisonTotalSeconds?: number;
samplingRate?: number;
onShowMoreClick?: () => void;
}
@ -55,7 +54,6 @@ export function FlameGraphTooltip({
comparisonCountExclusive,
comparisonTotalSamples,
comparisonTotalSeconds,
samplingRate,
onShowMoreClick,
}: Props) {
const theme = useEuiTheme();
@ -80,8 +78,6 @@ export function FlameGraphTooltip({
})
: undefined;
const prependString = samplingRate === 1.0 ? ' ' : '~';
return (
<TooltipContainer>
<EuiPanel paddingSize="s">
@ -104,7 +100,6 @@ export function FlameGraphTooltip({
formatValue={asPercentage}
showDifference
formatDifferenceAsPercentage
prependValue={prependString}
/>
<TooltipRow
label={
@ -120,7 +115,6 @@ export function FlameGraphTooltip({
showDifference
formatDifferenceAsPercentage
formatValue={asPercentage}
prependValue={prependString}
/>
</>
)}
@ -138,7 +132,6 @@ export function FlameGraphTooltip({
}
showDifference
formatDifferenceAsPercentage={false}
prependValue={prependString}
/>
<TooltipRow
label={i18n.translate('xpack.profiling.flameGraphTooltip.annualizedCo2', {
@ -149,7 +142,6 @@ export function FlameGraphTooltip({
formatValue={asWeight}
showDifference
formatDifferenceAsPercentage={false}
prependValue={prependString}
/>
<TooltipRow
label={i18n.translate('xpack.profiling.flameGraphTooltip.annualizedDollarCost', {
@ -160,7 +152,6 @@ export function FlameGraphTooltip({
formatValue={asCost}
showDifference
formatDifferenceAsPercentage={false}
prependValue={prependString}
/>
{onShowMoreClick && (
<>

View file

@ -194,7 +194,6 @@ export function FlameGraph({
frame={selected}
totalSeconds={primaryFlamegraph?.TotalSeconds ?? 0}
totalSamples={totalSamples}
samplingRate={primaryFlamegraph?.SamplingRate ?? 1.0}
/>
)}
</>

View file

@ -20,13 +20,11 @@ export function getImpactRows({
countExclusive,
totalSamples,
totalSeconds,
isApproximate = false,
}: {
countInclusive: number;
countExclusive: number;
totalSamples: number;
totalSeconds: number;
isApproximate: boolean;
}) {
const { selfCPU, totalCPU } = calculateImpactEstimates({
countInclusive,

View file

@ -34,10 +34,9 @@ export interface Props {
};
totalSamples: number;
totalSeconds: number;
samplingRate: number;
}
export function FrameInformationWindow({ frame, totalSamples, totalSeconds, samplingRate }: Props) {
export function FrameInformationWindow({ frame, totalSamples, totalSeconds }: Props) {
const aiAssistant = useObservabilityAIAssistant();
const promptMessages = useMemo<Message[] | undefined>(() => {
@ -155,16 +154,11 @@ export function FrameInformationWindow({ frame, totalSamples, totalSeconds, samp
sourceLine,
});
// Are the results sampled? If yes, prepend a '~'.
const isApproximate = (samplingRate ?? 1.0) === 1.0;
const prependString = isApproximate ? undefined : '~';
const impactRows = getImpactRows({
countInclusive,
countExclusive,
totalSamples,
totalSeconds,
isApproximate,
});
return (
@ -202,7 +196,7 @@ export function FrameInformationWindow({ frame, totalSamples, totalSeconds, samp
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem>
<KeyValueList rows={impactRows} prependString={prependString} />
<KeyValueList rows={impactRows} />
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>

View file

@ -331,7 +331,6 @@ export const TopNFunctionsGrid = forwardRef(
}}
totalSeconds={totalSeconds}
totalSamples={totalCount}
samplingRate={topNFunctions?.SamplingRate ?? 1.0}
/>
)}
</>