Skip to content

Commit 1a48634

Browse files
committed
Sort job duration changes by absolute duration
It was supposed to be like this from the start, but I forgot to apply the `abs` operation, as I got sidetracked with how to actually compare floats...
1 parent b9856b6 commit 1a48634

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ci/citool/src/analysis.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ pub fn output_largest_duration_changes(job_metrics: &HashMap<JobName, JobMetrics
225225
});
226226
}
227227
}
228-
changes.sort_by(|e1, e2| e1.change.partial_cmp(&e2.change).unwrap().reverse());
228+
changes.sort_by(|e1, e2| e1.change.abs().partial_cmp(&e2.change.abs()).unwrap().reverse());
229229

230230
println!("# Job duration changes");
231231
for (index, entry) in changes.into_iter().take(10).enumerate() {

0 commit comments

Comments
 (0)