Skip to content

Commit 0b7128a

Browse files
Merge pull request #1225 from miwig/fix-graphs-labels
Fix graphs labels
2 parents 82b6ead + 637aa96 commit 0b7128a

File tree

2 files changed

+26
-10
lines changed

2 files changed

+26
-10
lines changed

site/src/selector.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,8 @@ impl StatisticSeries {
479479
SeriesResponse {
480480
series: StatisticSeries {
481481
artifact_ids: ArtifactIdIter::new(artifact_ids.clone()),
482-
points: if metric == *"cpu-clock" {
483-
// Convert to seconds -- perf reports this measurement in
482+
points: if metric == *"cpu-clock" || metric == *"task-clock" {
483+
// Convert to seconds -- perf reports these measurements in
484484
// milliseconds
485485
points
486486
.into_iter()

site/static/index.html

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -323,24 +323,40 @@ <h3>This may take a while!</h3>
323323
let cacheStateNames = Object.keys(cacheStates);
324324
cacheStateNames.sort();
325325

326-
let yAxis = "Value";
326+
let yAxis = state.stat;
327+
let yAxisUnit = null;
327328
if (state.stat == "instructions:u") {
328-
yAxis = "Number of CPU instructions";
329+
yAxis = "CPU instructions";
330+
yAxisUnit = "count";
329331
} else if (state.stat == "cycles:u") {
330-
yAxis = "Number of CPU cycles";
332+
yAxis = "CPU cycles";
333+
yAxisUnit = "count";
331334
} else if (state.stat == "cpu-clock") {
332-
yAxis = "Wall time execution (seconds)";
335+
yAxis = "CPU clock";
336+
yAxisUnit = "seconds";
337+
} else if (state.stat == "task-clock") {
338+
yAxis = "Task clock";
339+
yAxisUnit = "seconds";
333340
} else if (state.stat == "wall-time") {
334-
yAxis = "Wall time execution (seconds)";
341+
yAxis = "Wall time";
342+
yAxisUnit = "seconds";
335343
} else if (state.stat == "max-rss") {
336-
yAxis = "Maximum resident set size (kb)";
344+
yAxis = "Maximum resident set size";
345+
yAxisUnit = "kB";
337346
} else if (state.stat == "faults") {
338347
yAxis = "Faults";
348+
yAxisUnit = "count";
339349
}
340-
if (!state.absolute) {
341-
yAxis = "% change from baseline";
350+
351+
if (state.kind == "raw" && benchName == "Summary") {
352+
yAxisUnit = "relative";
353+
} else if (state.kind == "percentfromfirst") {
354+
yAxisUnit = "% change from first";
355+
} else if (state.kind == "percentrelative") {
356+
yAxisUnit = "% change from previous";
342357
}
343358

359+
yAxis = yAxisUnit ? `${yAxis} (${yAxisUnit})` : yAxis;
344360
let yAxisLabel = i == 0 ? yAxis : null;
345361

346362
let seriesOpts = [{}];

0 commit comments

Comments
 (0)