File tree 2 files changed +10
-8
lines changed
2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -148,11 +148,13 @@ impl WorkerLocalStat {
148
148
type_id : work_id,
149
149
type_name : work_name,
150
150
} ;
151
- self . work_counters
152
- . entry ( work_id)
153
- . or_insert_with ( WorkerLocalStat :: counter_set)
154
- . iter_mut ( )
155
- . for_each ( |c| c. start ( ) ) ;
151
+ if self . is_enabled ( ) {
152
+ self . work_counters
153
+ . entry ( work_id)
154
+ . or_insert_with ( WorkerLocalStat :: counter_set)
155
+ . iter_mut ( )
156
+ . for_each ( |c| c. start ( ) ) ;
157
+ }
156
158
stat
157
159
}
158
160
Original file line number Diff line number Diff line change 1
1
use std:: time:: SystemTime ;
2
2
3
- #[ derive( Copy , Clone ) ]
3
+ #[ derive( Copy , Clone , Debug ) ]
4
4
pub ( super ) struct WorkCounterBase {
5
5
pub ( super ) total : f64 ,
6
6
pub ( super ) min : f64 ,
@@ -17,7 +17,7 @@ impl<T: 'static + WorkCounter + Clone> WorkCounterClone for T {
17
17
}
18
18
}
19
19
20
- pub ( super ) trait WorkCounter : WorkCounterClone {
20
+ pub ( super ) trait WorkCounter : WorkCounterClone + std :: fmt :: Debug {
21
21
// TODO: consolidate with crate::util::statistics::counter::Counter;
22
22
fn start ( & mut self ) ;
23
23
fn stop ( & mut self ) ;
@@ -63,7 +63,7 @@ impl WorkCounterBase {
63
63
}
64
64
}
65
65
66
- #[ derive( Copy , Clone ) ]
66
+ #[ derive( Copy , Clone , Debug ) ]
67
67
pub ( super ) struct WorkDuration {
68
68
base : WorkCounterBase ,
69
69
start_value : Option < SystemTime > ,
You can’t perform that action at this time.
0 commit comments