mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Profiling] Fix normalization when using scale factor mode (#151957)
This PR fixes a bug where the flamegraph tooltip shows the unscaled number of samples when using a scale factor != 1. Fixes https://github.com/elastic/prodfiler/issues/3013
This commit is contained in:
parent
fd1549846c
commit
44241bc6b3
1 changed files with 16 additions and 2 deletions
|
@ -106,6 +106,8 @@ function FlameGraphTooltip({
|
|||
countInclusive,
|
||||
countExclusive,
|
||||
totalSamples,
|
||||
baselineScaleFactor,
|
||||
comparisonScaleFactor,
|
||||
comparisonCountInclusive,
|
||||
comparisonCountExclusive,
|
||||
comparisonTotalSamples,
|
||||
|
@ -115,6 +117,8 @@ function FlameGraphTooltip({
|
|||
countInclusive: number;
|
||||
countExclusive: number;
|
||||
totalSamples: number;
|
||||
baselineScaleFactor?: number;
|
||||
comparisonScaleFactor?: number;
|
||||
comparisonCountInclusive?: number;
|
||||
comparisonCountExclusive?: number;
|
||||
comparisonTotalSamples?: number;
|
||||
|
@ -166,8 +170,16 @@ function FlameGraphTooltip({
|
|||
label={i18n.translate('xpack.profiling.flameGraphTooltip.samplesLabel', {
|
||||
defaultMessage: `Samples`,
|
||||
})}
|
||||
value={countInclusive}
|
||||
comparison={comparisonCountInclusive}
|
||||
value={
|
||||
isNumber(baselineScaleFactor)
|
||||
? countInclusive * baselineScaleFactor
|
||||
: countInclusive
|
||||
}
|
||||
comparison={
|
||||
isNumber(comparisonCountInclusive) && isNumber(comparisonScaleFactor)
|
||||
? comparisonCountInclusive * comparisonScaleFactor
|
||||
: undefined
|
||||
}
|
||||
formatAsPercentage={false}
|
||||
showChange
|
||||
/>
|
||||
|
@ -293,6 +305,8 @@ export const FlameGraph: React.FC<FlameGraphProps> = ({
|
|||
comparisonCountExclusive={comparisonNode?.CountExclusive}
|
||||
totalSamples={totalSamples}
|
||||
comparisonTotalSamples={comparisonFlamegraph?.CountInclusive[0]}
|
||||
baselineScaleFactor={baseline}
|
||||
comparisonScaleFactor={comparison}
|
||||
/>
|
||||
);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue