@@ -150,7 +150,8 @@ async fn populate_report(
150
150
}
151
151
152
152
pub struct ComparisonSummary {
153
- /// Significant comparisons ordered by magnitude from largest to smallest
153
+ /// Significant comparisons of magnitude small and above
154
+ /// and ordered by magnitude from largest to smallest
154
155
comparisons : Vec < TestResultComparison > ,
155
156
}
156
157
@@ -160,6 +161,7 @@ impl ComparisonSummary {
160
161
. statistics
161
162
. iter ( )
162
163
. filter ( |c| c. is_significant ( ) )
164
+ . filter ( |c| c. magnitude ( ) . is_small_or_above ( ) )
163
165
. cloned ( )
164
166
. collect :: < Vec < _ > > ( ) ;
165
167
// Skip empty commits, sometimes happens if there's a compiler bug or so.
@@ -270,27 +272,22 @@ impl ComparisonSummary {
270
272
}
271
273
272
274
pub fn confidence ( & self ) -> ComparisonConfidence {
273
- let mut num_very_small_changes = 0 ;
274
275
let mut num_small_changes = 0 ;
275
276
let mut num_medium_changes = 0 ;
276
277
for c in self . comparisons . iter ( ) {
277
278
match c. magnitude ( ) {
278
- Magnitude :: VerySmall => num_very_small_changes += 1 ,
279
279
Magnitude :: Small => num_small_changes += 1 ,
280
280
Magnitude :: Medium => num_medium_changes += 1 ,
281
281
Magnitude :: Large => return ComparisonConfidence :: DefinitelyRelevant ,
282
282
Magnitude :: VeryLarge => return ComparisonConfidence :: DefinitelyRelevant ,
283
+ Magnitude :: VerySmall => unreachable ! ( ) ,
283
284
}
284
285
}
285
286
286
- match (
287
- num_very_small_changes,
288
- num_small_changes,
289
- num_medium_changes,
290
- ) {
291
- ( _, _, m) if m > 1 => ComparisonConfidence :: DefinitelyRelevant ,
292
- ( _, _, m) if m > 0 => ComparisonConfidence :: ProbablyRelevant ,
293
- ( vs, s, _) if ( s * 2 ) + vs > 10 => ComparisonConfidence :: ProbablyRelevant ,
287
+ match ( num_small_changes, num_medium_changes) {
288
+ ( _, m) if m > 1 => ComparisonConfidence :: DefinitelyRelevant ,
289
+ ( _, 1 ) => ComparisonConfidence :: ProbablyRelevant ,
290
+ ( s, 0 ) if s > 10 => ComparisonConfidence :: ProbablyRelevant ,
294
291
_ => ComparisonConfidence :: MaybeRelevant ,
295
292
}
296
293
}
@@ -867,9 +864,9 @@ impl TestResultComparison {
867
864
Magnitude :: VerySmall
868
865
} else if change < threshold * 3.0 {
869
866
Magnitude :: Small
870
- } else if change < threshold * 10 .0 {
867
+ } else if change < threshold * 6 .0 {
871
868
Magnitude :: Medium
872
- } else if change < threshold * 25 .0 {
869
+ } else if change < threshold * 18 .0 {
873
870
Magnitude :: Large
874
871
} else {
875
872
Magnitude :: VeryLarge
@@ -1003,6 +1000,10 @@ pub enum Magnitude {
1003
1000
}
1004
1001
1005
1002
impl Magnitude {
1003
+ fn is_small_or_above ( & self ) -> bool {
1004
+ * self >= Self :: Small
1005
+ }
1006
+
1006
1007
fn is_medium_or_above ( & self ) -> bool {
1007
1008
* self >= Self :: Medium
1008
1009
}
0 commit comments