@@ -11,8 +11,6 @@ pub struct RawResult {
11
11
pub uri : String ,
12
12
pub pid : u32 ,
13
13
pub codspeed_time_per_round_ns : Vec < u64 > ,
14
-
15
- #[ serde( default ) ]
16
14
pub codspeed_iters_per_round : Vec < u64 > ,
17
15
}
18
16
@@ -39,14 +37,11 @@ impl RawResult {
39
37
. iter ( )
40
38
. map ( |t| * t as u128 )
41
39
. collect :: < Vec < _ > > ( ) ;
42
- let iters_per_round = if self . codspeed_iters_per_round . is_empty ( ) {
43
- vec ! [ 1 ; times_per_round_ns. len( ) ]
44
- } else {
45
- self . codspeed_iters_per_round
46
- . iter ( )
47
- . map ( |i| * i as u128 )
48
- . collect ( )
49
- } ;
40
+ let iters_per_round = self
41
+ . codspeed_iters_per_round
42
+ . iter ( )
43
+ . map ( |i| * i as u128 )
44
+ . collect ( ) ;
50
45
51
46
WalltimeBenchmark :: from_runtime_data (
52
47
self . name ,
@@ -68,13 +63,14 @@ mod tests {
68
63
"name": "BenchmarkFibonacci20-16",
69
64
"uri": "pkg/foo/fib_test.go::BenchmarkFibonacci20-16",
70
65
"pid": 777767,
71
- "codspeed_time_per_round_ns": [1000, 2000, 3000]
66
+ "codspeed_time_per_round_ns": [1000, 2000, 3000],
67
+ "codspeed_iters_per_round": [1, 2, 3]
72
68
}"# ;
73
69
let result: RawResult = serde_json:: from_str ( json_data) . unwrap ( ) ;
74
70
75
71
assert_eq ! ( result. name, "BenchmarkFibonacci20-16" ) ;
76
72
assert_eq ! ( result. pid, 777767 ) ;
77
73
assert_eq ! ( result. codspeed_time_per_round_ns. len( ) , 3 ) ;
78
- assert_eq ! ( result. codspeed_iters_per_round. len( ) , 0 ) ; // Default: 1 per round
74
+ assert_eq ! ( result. codspeed_iters_per_round. len( ) , 3 ) ;
79
75
}
80
76
}
0 commit comments