@@ -5,6 +5,9 @@ import SummaryTable from "../summary/summary-table.vue";
55import {createPersistedRef } from " ../../../storage" ;
66import {PREF_AGGREGATIONS_OPENED } from " ../prefs" ;
77import {CompileTestCase } from " ./common" ;
8+ import {computed } from " vue" ;
9+ import {diffClass , formatPercentChange } from " ../shared" ;
10+ import Tooltip from " ../tooltip.vue" ;
811
912const props = defineProps <{
1013 cases: TestCaseComparison <CompileTestCase >[];
@@ -24,6 +27,13 @@ function calculateSummary(
2427}
2528
2629const opened = createPersistedRef (PREF_AGGREGATIONS_OPENED );
30+
31+ const totalBefore = computed (() =>
32+ props .cases .map ((c ) => c .datumA ).reduce ((acc , v ) => acc + v , 0 )
33+ );
34+ const totalAfter = computed (() =>
35+ props .cases .map ((c ) => c .datumB ).reduce ((acc , v ) => acc + v , 0 )
36+ );
2737 </script >
2838
2939<template >
@@ -32,6 +42,17 @@ const opened = createPersistedRef(PREF_AGGREGATIONS_OPENED);
3242 <template #label >Aggregations</template >
3343 <template #content >
3444 <div >
45+ <div >
46+ Total accumulated change:
47+ <span :class =" diffClass(totalAfter - totalBefore)" >
48+ {{ formatPercentChange(totalBefore, totalAfter) }}</span
49+ >
50+ <Tooltip style =" margin-left : 1em " >
51+ The total accumulated change in the measured metric across all
52+ visible benchmarks. Computed by summing the value of the metric
53+ for all visible benchmarks and comparing the before/after sum.
54+ </Tooltip >
55+ </div >
3556 <div class =" aggregation-section" >
3657 <div class =" header" >Profile</div >
3758 <div class =" groups" >
0 commit comments