@@ -7,7 +7,7 @@ use std::sync::Arc;
77use std:: thread:: ThreadId ;
88use std:: u32;
99
10- use measureme:: { StringId , TimestampKind } ;
10+ use measureme:: { StringId } ;
1111
1212/// MmapSerializatioSink is faster on macOS and Linux
1313/// but FileSerializationSink is faster on Windows
@@ -63,8 +63,8 @@ const EVENT_FILTERS_BY_NAME: &[(&str, EventFilter)] = &[
6363 ( "incr-cache-load" , EventFilter :: INCR_CACHE_LOADS ) ,
6464] ;
6565
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 }
6868}
6969
7070
@@ -149,11 +149,10 @@ impl SelfProfilerRef {
149149 /// Record a query in-memory cache hit.
150150 #[ inline( always) ]
151151 pub fn query_cache_hit ( & self , query_name : impl QueryName ) {
152- self . non_guard_query_event (
152+ self . instant_query_event (
153153 |profiler| profiler. query_cache_hit_event_kind ,
154154 query_name,
155155 EventFilter :: QUERY_CACHE_HITS ,
156- TimestampKind :: Instant ,
157156 ) ;
158157 }
159158
@@ -184,22 +183,20 @@ impl SelfProfilerRef {
184183 }
185184
186185 #[ inline( always) ]
187- fn non_guard_query_event (
186+ fn instant_query_event (
188187 & self ,
189188 event_kind : fn ( & SelfProfiler ) -> StringId ,
190189 query_name : impl QueryName ,
191190 event_filter : EventFilter ,
192- timestamp_kind : TimestampKind
193191 ) {
194192 drop ( self . exec ( event_filter, |profiler| {
195193 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 ( ) ) ;
197195
198- profiler. profiler . record_event (
196+ profiler. profiler . record_instant_event (
199197 event_kind ( profiler) ,
200198 event_id,
201199 thread_id,
202- timestamp_kind,
203200 ) ;
204201
205202 TimingGuard :: none ( )
@@ -306,7 +303,7 @@ impl<'a> TimingGuard<'a> {
306303 event_kind : StringId ,
307304 event_id : StringId ,
308305 ) -> 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 ( ) ) ;
310307 let raw_profiler = & profiler. profiler ;
311308 let timing_guard = raw_profiler. start_recording_interval_event ( event_kind,
312309 event_id,
0 commit comments