@@ -44,26 +44,23 @@ pub async fn handle_triage(
44
44
let mut before = start. clone ( ) ;
45
45
46
46
let mut num_comparisons = 0 ;
47
+ let stat = "instructions:u" . to_owned ( ) ;
48
+ let benchmark_map = ctxt. get_benchmark_category_map ( ) . await ;
47
49
loop {
48
- let comparison = match compare_given_commits (
49
- before,
50
- next. clone ( ) ,
51
- "instructions:u" . to_owned ( ) ,
52
- ctxt,
53
- & master_commits,
54
- )
55
- . await
56
- . map_err ( |e| format ! ( "error comparing commits: {}" , e) ) ?
57
- {
58
- Some ( c) => c,
59
- None => {
60
- log:: info!(
61
- "No data found for end bound {:?}. Ending comparison..." ,
62
- next
63
- ) ;
64
- break ;
65
- }
66
- } ;
50
+ let comparison =
51
+ match compare_given_commits ( before, next. clone ( ) , stat. clone ( ) , ctxt, & master_commits)
52
+ . await
53
+ . map_err ( |e| format ! ( "error comparing commits: {}" , e) ) ?
54
+ {
55
+ Some ( c) => c,
56
+ None => {
57
+ log:: info!(
58
+ "No data found for end bound {:?}. Ending comparison..." ,
59
+ next
60
+ ) ;
61
+ break ;
62
+ }
63
+ } ;
67
64
num_comparisons += 1 ;
68
65
log:: info!(
69
66
"Comparing {} to {}" ,
@@ -72,7 +69,7 @@ pub async fn handle_triage(
72
69
) ;
73
70
74
71
// handle results of comparison
75
- populate_report ( ctxt , & comparison , & mut report) . await ;
72
+ populate_report ( & comparison , & benchmark_map , & mut report) . await ;
76
73
77
74
// Check that there is a next commit and that the
78
75
// after commit is not equal to `end`
@@ -86,7 +83,24 @@ pub async fn handle_triage(
86
83
}
87
84
let end = end. unwrap_or ( next) ;
88
85
89
- let report = generate_report ( & start, & end, report, num_comparisons) . await ;
86
+ // Summarize the entire triage from start commit to end commit
87
+ let summary =
88
+ match compare_given_commits ( start. clone ( ) , end. clone ( ) , stat, ctxt, master_commits)
89
+ . await
90
+ . map_err ( |e| format ! ( "error comparing beginning and ending commits: {}" , e) ) ?
91
+ {
92
+ Some ( summary_comparison) => {
93
+ let ( primary, secondary) = summary_comparison
94
+ . clone ( )
95
+ . summarize_by_category ( & benchmark_map) ;
96
+ let mut result = String :: from ( "**Summary**:\n " ) ;
97
+ write_summary_table ( & primary, & secondary, false , & mut result) ;
98
+ result
99
+ }
100
+ None => String :: from ( "**ERROR**: no data found for end bound" ) ,
101
+ } ;
102
+
103
+ let report = generate_report ( & start, & end, summary, report, num_comparisons) . await ;
90
104
Ok ( api:: triage:: Response ( report) )
91
105
}
92
106
@@ -144,12 +158,11 @@ pub async fn handle_compare(
144
158
}
145
159
146
160
async fn populate_report (
147
- ctxt : & SiteCtxt ,
148
161
comparison : & ArtifactComparison ,
162
+ benchmark_map : & HashMap < Benchmark , Category > ,
149
163
report : & mut HashMap < Direction , Vec < String > > ,
150
164
) {
151
- let benchmark_map = ctxt. get_benchmark_category_map ( ) . await ;
152
- let ( primary, secondary) = comparison. clone ( ) . summarize_by_category ( benchmark_map) ;
165
+ let ( primary, secondary) = comparison. clone ( ) . summarize_by_category ( & benchmark_map) ;
153
166
// Get the combined direction of the primary and secondary summaries
154
167
let direction = match ( primary. direction ( ) , secondary. direction ( ) ) {
155
168
( Some ( d1) , Some ( d2) ) if d1 != d2 => Direction :: Mixed ,
@@ -794,7 +807,7 @@ impl ArtifactComparison {
794
807
/// Splits an artifact comparison into primary and secondary summaries based on benchmark category
795
808
pub fn summarize_by_category (
796
809
self ,
797
- category_map : HashMap < Benchmark , Category > ,
810
+ category_map : & HashMap < Benchmark , Category > ,
798
811
) -> ( ArtifactComparisonSummary , ArtifactComparisonSummary ) {
799
812
let ( primary, secondary) = self
800
813
. comparisons
@@ -1141,6 +1154,7 @@ impl Magnitude {
1141
1154
async fn generate_report (
1142
1155
start : & Bound ,
1143
1156
end : & Bound ,
1157
+ summary : String ,
1144
1158
mut report : HashMap < Direction , Vec < String > > ,
1145
1159
num_comparisons : usize ,
1146
1160
) -> String {
@@ -1180,6 +1194,8 @@ TODO: Summary
1180
1194
Triage done by **@???**.
1181
1195
Revision range: [{first_commit}..{last_commit}](https://perf.rust-lang.org/?start={first_commit}&end={last_commit}&absolute=false&stat=instructions%3Au)
1182
1196
1197
+ {summary}
1198
+
1183
1199
{num_regressions} Regressions, {num_improvements} Improvements, {num_mixed} Mixed; ??? of them in rollups
1184
1200
{num_comparisons} artifact comparisons made in total
1185
1201
0 commit comments