File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ impl SchedulerStat {
28
28
let sum_logs = logs. sum :: < f64 > ( ) ;
29
29
( sum_logs / values. len ( ) as f64 ) . exp ( )
30
30
}
31
+
31
32
fn min ( & self , values : & [ f64 ] ) -> f64 {
32
33
let mut min = values[ 0 ] ;
33
34
for v in values {
@@ -37,6 +38,7 @@ impl SchedulerStat {
37
38
}
38
39
min
39
40
}
41
+
40
42
fn max ( & self , values : & [ f64 ] ) -> f64 {
41
43
let mut max = values[ 0 ] ;
42
44
for v in values {
@@ -47,6 +49,10 @@ impl SchedulerStat {
47
49
max
48
50
}
49
51
52
+ fn sum ( & self , values : & [ f64 ] ) -> f64 {
53
+ values. iter ( ) . sum ( )
54
+ }
55
+
50
56
pub fn harness_stat ( & self ) -> HashMap < String , String > {
51
57
let mut stat = HashMap :: new ( ) ;
52
58
// Work counts
@@ -77,6 +83,16 @@ impl SchedulerStat {
77
83
format ! ( "work.{}.time.geomean" , self . work_name( n) ) ,
78
84
format ! ( "{:.2}" , geomean) ,
79
85
) ;
86
+ let sum = self . sum (
87
+ & durations
88
+ . iter ( )
89
+ . map ( |d| d. as_nanos ( ) as f64 )
90
+ . collect :: < Vec < _ > > ( ) ,
91
+ ) ;
92
+ stat. insert (
93
+ format ! ( "work.{}.time.sum" , self . work_name( n) ) ,
94
+ format ! ( "{:.2}" , sum) ,
95
+ ) ;
80
96
}
81
97
let durations = total_durations
82
98
. iter ( )
You can’t perform that action at this time.
0 commit comments