Initial work on tracking memory usage

This commit is contained in:
David Peter authored and David Peter committed 2024-12-29 12:18:55 +01:00
1 parent f78f482d8f
commit 6556b2bd46
13 files changed
+68 -7

No files matched your search

+3 -3
View File
@@ -86,7 +86,7 @@ impl CPUTimer {
Self { job_object }
}
pub fn stop(&self) -> (Second, Second) {
pub fn stop(&self) -> (Second, Second, u64) {
let mut job_object_info =
mem::MaybeUninit::<JOBOBJECT_BASIC_ACCOUNTING_INFORMATION>::uninit();
@@ -114,9 +114,9 @@ impl CPUTimer {
// for all active processes associated with the job, as well as all terminated
// processes no longer associated with the job, in 100-nanosecond ticks."
let kernel: i64 = job_object_info.TotalKernelTime / HUNDRED_NS_PER_MS;
(user as f64 * 1e-6, kernel as f64 * 1e-6)
(user as f64 * 1e-6, kernel as f64 * 1e-6, 0)
} else {
(0.0, 0.0)
(0.0, 0.0, 0)
}
}
}