Skip to content

Commit

Permalink
[8.10] [Profiling] removing ~ symbol (#164595) (#164680)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.10`:
- [[Profiling] removing ~ symbol
(#164595)](#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":"[email protected]"},"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](https://github.com/elastic/kibana/assets/55978943/cd18f0a4-54b9-4dc6-a7d3-780189bf8e30)\r\n\r\nAfter\r\n![Screenshot
2023-08-23 at 15
04\r\n11](https://github.com/elastic/kibana/assets/55978943/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](https://github.com/elastic/kibana/assets/55978943/cd18f0a4-54b9-4dc6-a7d3-780189bf8e30)\r\n\r\nAfter\r\n![Screenshot
2023-08-23 at 15
04\r\n11](https://github.com/elastic/kibana/assets/55978943/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](https://github.com/elastic/kibana/assets/55978943/cd18f0a4-54b9-4dc6-a7d3-780189bf8e30)\r\n\r\nAfter\r\n![Screenshot
2023-08-23 at 15
04\r\n11](https://github.com/elastic/kibana/assets/55978943/bb8bbbec-ee35-446e-8ec8-865fe9d1b831)","sha":"ad55946c1275d4ce2bd8cc453580acf73bbc17bf"}}]}]
BACKPORT-->

Co-authored-by: Cauê Marcondes <[email protected]>
  • Loading branch information
kibanamachine and cauemarcondes authored Aug 24, 2023
1 parent b8f9d4a commit 9f91b8d
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ interface Props {
comparisonCountExclusive?: number;
comparisonTotalSamples?: number;
comparisonTotalSeconds?: number;
samplingRate?: number;
onShowMoreClick?: () => void;
}

Expand All @@ -55,7 +54,6 @@ export function FlameGraphTooltip({
comparisonCountExclusive,
comparisonTotalSamples,
comparisonTotalSeconds,
samplingRate,
onShowMoreClick,
}: Props) {
const theme = useEuiTheme();
Expand All @@ -80,8 +78,6 @@ export function FlameGraphTooltip({
})
: undefined;

const prependString = samplingRate === 1.0 ? ' ' : '~';

return (
<TooltipContainer>
<EuiPanel paddingSize="s">
Expand All @@ -104,7 +100,6 @@ export function FlameGraphTooltip({
formatValue={asPercentage}
showDifference
formatDifferenceAsPercentage
prependValue={prependString}
/>
<TooltipRow
label={
Expand All @@ -120,7 +115,6 @@ export function FlameGraphTooltip({
showDifference
formatDifferenceAsPercentage
formatValue={asPercentage}
prependValue={prependString}
/>
</>
)}
Expand All @@ -138,7 +132,6 @@ export function FlameGraphTooltip({
}
showDifference
formatDifferenceAsPercentage={false}
prependValue={prependString}
/>
<TooltipRow
label={i18n.translate('xpack.profiling.flameGraphTooltip.annualizedCo2', {
Expand All @@ -149,7 +142,6 @@ export function FlameGraphTooltip({
formatValue={asWeight}
showDifference
formatDifferenceAsPercentage={false}
prependValue={prependString}
/>
<TooltipRow
label={i18n.translate('xpack.profiling.flameGraphTooltip.annualizedDollarCost', {
Expand All @@ -160,7 +152,6 @@ export function FlameGraphTooltip({
formatValue={asCost}
showDifference
formatDifferenceAsPercentage={false}
prependValue={prependString}
/>
{onShowMoreClick && (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ export function FlameGraph({
frame={selected}
totalSeconds={primaryFlamegraph?.TotalSeconds ?? 0}
totalSamples={totalSamples}
samplingRate={primaryFlamegraph?.SamplingRate ?? 1.0}
/>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>(() => {
Expand Down Expand Up @@ -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 (
Expand Down Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ export const TopNFunctionsGrid = forwardRef(
}}
totalSeconds={totalSeconds}
totalSamples={totalCount}
samplingRate={topNFunctions?.SamplingRate ?? 1.0}
/>
)}
</>
Expand Down

0 comments on commit 9f91b8d

Please sign in to comment.