Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Profiling] removing ~ symbol #164595

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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