Skip to content

Commit 7b8ab81

Browse files
authored
Merge pull request #1687 from Kobzol/compare-table-units
Add units to wall-time in compage page tables
2 parents 260098f + 0141321 commit 7b8ab81

File tree

3 files changed

+36
-12
lines changed

3 files changed

+36
-12
lines changed

site/frontend/src/pages/compare/compile/comparisons-table.vue

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Tooltip from "../tooltip.vue";
44
import {ArtifactDescription} from "../types";
55
import {percentClass} from "../shared";
66
import {CompileBenchmarkMap, CompileTestCase} from "./common";
7+
import {computed} from "vue";
78
89
const props = defineProps<{
910
id: string;
@@ -92,6 +93,16 @@ Category: ${metadata.category}
9293
9394
return tooltip;
9495
}
96+
97+
const unit = computed(() => {
98+
// The DB stored wall-time data in seconds for compile benchmarks, so it is
99+
// hardcoded here
100+
if (props.stat == "wall-time") {
101+
return "s";
102+
} else {
103+
return null;
104+
}
105+
});
95106
</script>
96107

97108
<template>
@@ -194,16 +205,16 @@ Category: ${metadata.category}
194205
</td>
195206
<td v-if="showRawData" class="numeric">
196207
<a v-bind:href="detailedQueryRawDataLink(commitA, comparison)">
197-
<abbr :title="comparison.datumA.toString()">{{
198-
prettifyRawNumber(comparison.datumA)
199-
}}</abbr>
208+
<abbr :title="comparison.datumA.toString()"
209+
>{{ prettifyRawNumber(comparison.datumA) }}{{ unit }}</abbr
210+
>
200211
</a>
201212
</td>
202213
<td v-if="showRawData" class="numeric">
203214
<a v-bind:href="detailedQueryRawDataLink(commitB, comparison)">
204-
<abbr :title="comparison.datumB.toString()">{{
205-
prettifyRawNumber(comparison.datumB)
206-
}}</abbr>
215+
<abbr :title="comparison.datumB.toString()"
216+
>{{ prettifyRawNumber(comparison.datumB) }}{{ unit }}</abbr
217+
>
207218
</a>
208219
</td>
209220
</tr>

site/frontend/src/pages/compare/runtime/comparisons-table.vue

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,28 @@ import {TestCaseComparison} from "../data";
33
import Tooltip from "../tooltip.vue";
44
import {percentClass} from "../shared";
55
import {RuntimeTestCase} from "./common";
6+
import {computed} from "vue";
67
78
const props = defineProps<{
89
comparisons: TestCaseComparison<RuntimeTestCase>[];
910
hasNonRelevant: boolean;
1011
showRawData: boolean;
12+
metric: string;
1113
}>();
1214
1315
function prettifyRawNumber(number: number): string {
1416
return number.toLocaleString();
1517
}
18+
19+
const unit = computed(() => {
20+
// The DB stored wall-time data in nanoseconds for runtime benchmarks, so it is
21+
// hardcoded here
22+
if (props.metric == "wall-time") {
23+
return "ns";
24+
} else {
25+
return null;
26+
}
27+
});
1628
</script>
1729

1830
<template>
@@ -90,14 +102,14 @@ function prettifyRawNumber(number: number): string {
90102
</div>
91103
</td>
92104
<td v-if="showRawData" class="numeric">
93-
<abbr :title="comparison.datumA.toString()">{{
94-
prettifyRawNumber(comparison.datumA)
95-
}}</abbr>
105+
<abbr :title="comparison.datumA.toString()"
106+
>{{ prettifyRawNumber(comparison.datumA) }}{{ unit }}</abbr
107+
>
96108
</td>
97109
<td v-if="showRawData" class="numeric">
98-
<abbr :title="comparison.datumB.toString()">{{
99-
prettifyRawNumber(comparison.datumB)
100-
}}</abbr>
110+
<abbr :title="comparison.datumB.toString()"
111+
>{{ prettifyRawNumber(comparison.datumB) }}{{ unit }}</abbr
112+
>
101113
</td>
102114
</tr>
103115
</template>

site/frontend/src/pages/compare/runtime/runtime-page.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ const filteredSummary = computed(() => computeSummary(comparisons.value));
124124
:comparisons="comparisons"
125125
:has-non-relevant="allComparisons.length > 0"
126126
:show-raw-data="filter.showRawData"
127+
:metric="selector.stat"
127128
/>
128129
</template>
129130

0 commit comments

Comments
 (0)