@@ -7,7 +7,7 @@ use std::sync::Arc;
7
7
use std:: thread:: ThreadId ;
8
8
use std:: u32;
9
9
10
- use measureme:: { StringId , TimestampKind } ;
10
+ use measureme:: { StringId } ;
11
11
12
12
/// MmapSerializatioSink is faster on macOS and Linux
13
13
/// but FileSerializationSink is faster on Windows
@@ -63,8 +63,8 @@ const EVENT_FILTERS_BY_NAME: &[(&str, EventFilter)] = &[
63
63
( "incr-cache-load" , EventFilter :: INCR_CACHE_LOADS ) ,
64
64
] ;
65
65
66
- fn thread_id_to_u64 ( tid : ThreadId ) -> u64 {
67
- unsafe { mem:: transmute :: < ThreadId , u64 > ( tid) }
66
+ fn thread_id_to_u32 ( tid : ThreadId ) -> u32 {
67
+ unsafe { mem:: transmute :: < ThreadId , u64 > ( tid) as u32 }
68
68
}
69
69
70
70
@@ -149,11 +149,10 @@ impl SelfProfilerRef {
149
149
/// Record a query in-memory cache hit.
150
150
#[ inline( always) ]
151
151
pub fn query_cache_hit ( & self , query_name : impl QueryName ) {
152
- self . non_guard_query_event (
152
+ self . instant_query_event (
153
153
|profiler| profiler. query_cache_hit_event_kind ,
154
154
query_name,
155
155
EventFilter :: QUERY_CACHE_HITS ,
156
- TimestampKind :: Instant ,
157
156
) ;
158
157
}
159
158
@@ -184,22 +183,20 @@ impl SelfProfilerRef {
184
183
}
185
184
186
185
#[ inline( always) ]
187
- fn non_guard_query_event (
186
+ fn instant_query_event (
188
187
& self ,
189
188
event_kind : fn ( & SelfProfiler ) -> StringId ,
190
189
query_name : impl QueryName ,
191
190
event_filter : EventFilter ,
192
- timestamp_kind : TimestampKind
193
191
) {
194
192
drop ( self . exec ( event_filter, |profiler| {
195
193
let event_id = SelfProfiler :: get_query_name_string_id ( query_name) ;
196
- let thread_id = thread_id_to_u64 ( std:: thread:: current ( ) . id ( ) ) ;
194
+ let thread_id = thread_id_to_u32 ( std:: thread:: current ( ) . id ( ) ) ;
197
195
198
- profiler. profiler . record_event (
196
+ profiler. profiler . record_instant_event (
199
197
event_kind ( profiler) ,
200
198
event_id,
201
199
thread_id,
202
- timestamp_kind,
203
200
) ;
204
201
205
202
TimingGuard :: none ( )
@@ -306,7 +303,7 @@ impl<'a> TimingGuard<'a> {
306
303
event_kind : StringId ,
307
304
event_id : StringId ,
308
305
) -> TimingGuard < ' a > {
309
- let thread_id = thread_id_to_u64 ( std:: thread:: current ( ) . id ( ) ) ;
306
+ let thread_id = thread_id_to_u32 ( std:: thread:: current ( ) . id ( ) ) ;
310
307
let raw_profiler = & profiler. profiler ;
311
308
let timing_guard = raw_profiler. start_recording_interval_event ( event_kind,
312
309
event_id,
0 commit comments