Do not display total percentage next to self size.
This is confusing. Calculate percentage of self size instead.
Change-Id: I2c6ef9a40dd010fbe744c18226bc461e78e6e35f
diff --git a/ui/src/frontend/flamegraph.ts b/ui/src/frontend/flamegraph.ts
index de39e1d..36923f8 100644
--- a/ui/src/frontend/flamegraph.ts
+++ b/ui/src/frontend/flamegraph.ts
@@ -259,11 +259,13 @@
let selfSizeWidth = 0;
if (this.hoveredCallsite.selfSize > 0) {
+ const selfPercentage =
+ this.hoveredCallsite.selfSize / this.totalSize * 100;
const selfSizeText = `self: ${
this.displaySize(
this.hoveredCallsite.selfSize,
unit,
- unit === 'B' ? 1024 : 1000)} (${percentage.toFixed(2)}%)`;
+ unit === 'B' ? 1024 : 1000)} (${selfPercentage.toFixed(2)}%)`;
lineSplitter = splitIfTooBig(
selfSizeText, width, ctx.measureText(selfSizeText).width);
selfSizeWidth = lineSplitter.lineWidth;