Skip to content

Commit

Permalink
[Profiling] removing ~ symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
cauemarcondes committed Aug 23, 2023
1 parent d65b02c commit 9ad7e5f
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 9ad7e5f

Please sign in to comment.