fix for windows build error
This commit is contained in:
parent
f4b54db399
commit
70a150152c
@ -1029,13 +1029,23 @@ pub async fn collect_process_metrics(
|
|||||||
|
|
||||||
(Some(rchar), Some(wchar))
|
(Some(rchar), Some(wchar))
|
||||||
} else {
|
} else {
|
||||||
// Fallback to sysinfo if we can't read /proc (permissions, non-Linux, etc.)
|
// Fallback to sysinfo if we can't read /proc (permissions)
|
||||||
let disk_usage = process.disk_usage();
|
let disk_usage = process.disk_usage();
|
||||||
(
|
(
|
||||||
Some(disk_usage.total_read_bytes),
|
Some(disk_usage.total_read_bytes),
|
||||||
Some(disk_usage.total_written_bytes),
|
Some(disk_usage.total_written_bytes),
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "linux"))]
|
||||||
|
let (read_bytes, write_bytes) = {
|
||||||
|
let disk_usage = process.disk_usage();
|
||||||
|
(
|
||||||
|
Some(disk_usage.total_read_bytes),
|
||||||
|
Some(disk_usage.total_written_bytes),
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
let working_directory = process.cwd().map(|p| p.to_string_lossy().to_string());
|
let working_directory = process.cwd().map(|p| p.to_string_lossy().to_string());
|
||||||
let executable_path = process.exe().map(|p| p.to_string_lossy().to_string());
|
let executable_path = process.exe().map(|p| p.to_string_lossy().to_string());
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user