Skip to content

Commit 080abd3

Browse files
committed
Site: Fix graphs page labels always reading "% change from baseline"
regardless of selected stat Label summary graphs as "(relative)"
1 parent e2ec11a commit 080abd3

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

site/static/index.html

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,23 +324,33 @@ <h3>This may take a while!</h3>
324324
cacheStateNames.sort();
325325

326326
let yAxis = "Value";
327+
let yAxisUnit = null;
327328
if (state.stat == "instructions:u") {
328329
yAxis = "Number of CPU instructions";
329330
} else if (state.stat == "cycles:u") {
330331
yAxis = "Number of CPU cycles";
331332
} else if (state.stat == "cpu-clock") {
332-
yAxis = "Wall time execution (seconds)";
333+
yAxis = "Wall time execution";
334+
yAxisUnit = "seconds";
333335
} else if (state.stat == "wall-time") {
334-
yAxis = "Wall time execution (seconds)";
336+
yAxis = "Wall time execution";
337+
yAxisUnit = "seconds";
335338
} else if (state.stat == "max-rss") {
336-
yAxis = "Maximum resident set size (kb)";
339+
yAxis = "Maximum resident set size";
340+
yAxisUnit = "kb";
337341
} else if (state.stat == "faults") {
338342
yAxis = "Faults";
339343
}
340-
if (!state.absolute) {
341-
yAxis = "% change from baseline";
344+
345+
if (state.kind == "raw" && benchName == "Summary") {
346+
yAxisUnit = "relative";
347+
} else if (state.kind == "percentfromfirst") {
348+
yAxisUnit = "% change from baseline";
349+
} else if (state.kind == "percentrelative") {
350+
yAxisUnit = "% change from previous";
342351
}
343352

353+
yAxis = yAxisUnit ? `${yAxis} (${yAxisUnit})` : yAxis;
344354
let yAxisLabel = i == 0 ? yAxis : null;
345355

346356
let seriesOpts = [{}];

0 commit comments

Comments
 (0)