File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -62,11 +62,15 @@ macro_rules! define_categories {
62
62
}
63
63
64
64
fn print( & self , lock: & mut StderrLock <' _>) {
65
- writeln!( lock, "| Phase | Time (ms) | Queries | Hits (%) |" )
65
+ writeln!( lock, "| Phase | Time (ms) \
66
+ | Time (%) | Queries | Hits (%)")
66
67
. unwrap( ) ;
67
- writeln!( lock, "| ---------------- | -------------- | -------------- | -------- |" )
68
+ writeln!( lock, "| ---------------- | -------------- \
69
+ | -------- | -------------- | --------")
68
70
. unwrap( ) ;
69
71
72
+ let total_time = ( $( self . times. $name + ) * 0 ) as f32 ;
73
+
70
74
$(
71
75
let ( hits, total) = self . query_counts. $name;
72
76
let ( hits, total) = if total > 0 {
@@ -78,11 +82,12 @@ macro_rules! define_categories {
78
82
79
83
writeln!(
80
84
lock,
81
- "| {0: <16} | {1: <14} | {2: <14 } | {3: <8 } |" ,
85
+ "| {0: <16} | {1: <14} | {2: <8.2 } | {3: <14 } | {4: <8} " ,
82
86
stringify!( $name) ,
83
87
self . times. $name / 1_000_000 ,
88
+ ( ( self . times. $name as f32 ) / total_time) * 100.0 ,
84
89
total,
85
- hits
90
+ hits,
86
91
) . unwrap( ) ;
87
92
) *
88
93
}
You can’t perform that action at this time.
0 commit comments