@@ -19,10 +19,6 @@ impl Into<InternalSelfProfile> for SelfProfile {
19
19
. iter ( )
20
20
. map ( |qd| u64:: try_from ( qd. self_time . as_nanos ( ) ) . unwrap ( ) )
21
21
. collect ( ) ,
22
- number_of_cache_misses : query_data
23
- . iter ( )
24
- . map ( |qd| qd. number_of_cache_misses )
25
- . collect ( ) ,
26
22
number_of_cache_hits : query_data
27
23
. iter ( )
28
24
. map ( |qd| qd. number_of_cache_hits )
@@ -52,7 +48,6 @@ impl From<InternalSelfProfile> for SelfProfile {
52
48
InternalSelfProfile :: Perf {
53
49
label,
54
50
self_time,
55
- number_of_cache_misses,
56
51
number_of_cache_hits,
57
52
invocation_count,
58
53
blocked_time,
@@ -61,7 +56,6 @@ impl From<InternalSelfProfile> for SelfProfile {
61
56
let mut query_data = Vec :: with_capacity ( label. len ( ) ) ;
62
57
let label = label. into_iter ( ) ;
63
58
let mut self_time = self_time. into_iter ( ) . map ( from_nanoseconds_to_duration) ;
64
- let mut number_of_cache_misses = number_of_cache_misses. into_iter ( ) ;
65
59
let mut number_of_cache_hits = number_of_cache_hits. into_iter ( ) ;
66
60
let mut invocation_count = invocation_count. into_iter ( ) ;
67
61
let mut blocked_time = blocked_time. into_iter ( ) . map ( from_nanoseconds_to_duration) ;
@@ -72,7 +66,6 @@ impl From<InternalSelfProfile> for SelfProfile {
72
66
query_data. push ( QueryData {
73
67
label,
74
68
self_time : self_time. next ( ) . unwrap ( ) ,
75
- number_of_cache_misses : number_of_cache_misses. next ( ) . unwrap ( ) ,
76
69
number_of_cache_hits : number_of_cache_hits. next ( ) . unwrap ( ) ,
77
70
invocation_count : invocation_count. next ( ) . unwrap ( ) ,
78
71
blocked_time : blocked_time. next ( ) . unwrap ( ) ,
@@ -91,14 +84,14 @@ impl From<InternalSelfProfile> for SelfProfile {
91
84
#[ derive( Serialize , Deserialize ) ]
92
85
#[ serde( untagged) ]
93
86
enum InternalSelfProfile {
94
- Rustc {
95
- query_data : Vec < QueryData > ,
96
- } ,
87
+ // We don't want to serialize in the verbose format,
88
+ // it's too big.
89
+ #[ serde( skip_serializing) ]
90
+ Rustc { query_data : Vec < QueryData > } ,
97
91
Perf {
98
92
label : Vec < QueryLabel > ,
99
93
// nanos
100
94
self_time : Vec < u64 > ,
101
- number_of_cache_misses : Vec < u32 > ,
102
95
number_of_cache_hits : Vec < u32 > ,
103
96
invocation_count : Vec < u32 > ,
104
97
// nanos
@@ -119,15 +112,20 @@ fn from_nanoseconds_to_duration(nanos: u64) -> Duration {
119
112
)
120
113
}
121
114
122
- #[ derive( Serialize , Deserialize , Clone , Debug ) ]
115
+ #[ derive( Deserialize , Clone , Debug ) ]
123
116
pub struct QueryData {
124
117
pub label : QueryLabel ,
125
118
pub self_time : Duration ,
126
- pub number_of_cache_misses : u32 ,
127
119
pub number_of_cache_hits : u32 ,
128
120
pub invocation_count : u32 ,
129
121
pub blocked_time : Duration ,
130
122
pub incremental_load_time : Duration ,
131
123
}
132
124
125
+ impl QueryData {
126
+ pub fn number_of_cache_misses ( & self ) -> u32 {
127
+ self . invocation_count - self . number_of_cache_hits
128
+ }
129
+ }
130
+
133
131
crate :: intern!( pub struct QueryLabel ) ;
0 commit comments