File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
- use collector:: { CommitData } ;
1
+ use collector:: CommitData ;
2
2
use std:: fs;
3
3
4
4
fn main ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
@@ -14,16 +14,15 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
14
14
if filename. starts_with ( "commit-" ) && filename. ends_with ( ".sz" ) {
15
15
eprintln ! ( "{:?}" , filename) ;
16
16
use std:: io:: Read ;
17
- let mut out =
18
- String :: with_capacity ( snap:: decompress_len ( & file_contents) . unwrap_or ( 0 ) ) ;
17
+ let mut out = String :: with_capacity ( snap:: decompress_len ( & file_contents) . unwrap_or ( 0 ) ) ;
19
18
let mut szip_reader = snap:: Reader :: new ( & file_contents[ ..] ) ;
20
19
szip_reader. read_to_string ( & mut out) . unwrap ( ) ;
21
20
let file_contents = out. as_str ( ) ;
22
21
23
22
let contents: CommitData = match serde_json:: from_str ( & file_contents) {
24
23
Ok ( json) => json,
25
24
Err ( err) => {
26
- log :: error !( "Failed to parse JSON for {}: {:?}" , filename, err) ;
25
+ eprintln ! ( "Failed to parse JSON for {}: {:?}" , filename, err) ;
27
26
continue ;
28
27
}
29
28
} ;
Original file line number Diff line number Diff line change @@ -102,11 +102,13 @@ pub struct QueryData {
102
102
self_time : u64 ,
103
103
pub number_of_cache_hits : u32 ,
104
104
pub invocation_count : u32 ,
105
+ #[ serde( deserialize_with = "SerdeDuration::into_nanos" ) ]
105
106
blocked_time : u64 ,
107
+ #[ serde( deserialize_with = "SerdeDuration::into_nanos" ) ]
106
108
incremental_load_time : u64 ,
107
109
}
108
110
109
- #[ derive( Deserialize ) ]
111
+ #[ derive( Debug , Deserialize ) ]
110
112
#[ serde( untagged) ]
111
113
enum SerdeDuration {
112
114
Nanoseconds ( u64 ) ,
You can’t perform that action at this time.
0 commit comments