parthchandra commented on code in PR #3688:
URL: https://github.com/apache/datafusion-comet/pull/3688#discussion_r3065730523
##########
native/common/src/tracing.rs:
##########
@@ -80,23 +79,23 @@ impl Recorder {
let json = format!(
"{{ \"name\": \"{}\", \"cat\": \"PERF\", \"ph\": \"{ph}\",
\"pid\": 1, \"tid\": {}, \"ts\": {} }},\n",
name,
- Self::get_thread_id(),
+ get_thread_id(),
self.now.elapsed().as_micros()
);
let mut writer = self.writer.lock().unwrap();
writer
.write_all(json.as_bytes())
.expect("Error writing tracing");
}
+}
- fn get_thread_id() -> u64 {
- let thread_id = std::thread::current().id();
- format!("{thread_id:?}")
- .trim_start_matches("ThreadId(")
- .trim_end_matches(")")
- .parse()
- .expect("Error parsing thread id")
- }
+pub fn get_thread_id() -> u64 {
+ let thread_id = std::thread::current().id();
Review Comment:
Claude suggests `std::thread::current().id().as_u64()` is better.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]