don't refresh system stats when only reporting process stats (#784)

This commit is contained in:
bmc-msft
2021-04-09 14:12:13 -04:00
committed by GitHub
parent 4086e7695e
commit 4f6432bdc3
2 changed files with 16 additions and 4 deletions

View File

@ -301,11 +301,14 @@ fn try_report_iter_update(
}
async fn report_fuzzer_sys_info(worker_id: usize, run_id: Uuid, fuzzer_pid: u32) -> Result<()> {
loop {
system::refresh()?;
// Allow for sampling CPU usage.
time::delay_for(PROC_INFO_COLLECTION_DELAY).await;
// Allow for sampling CPU usage.
time::delay_for(PROC_INFO_COLLECTION_DELAY).await;
loop {
// process doesn't exist
if !system::refresh_process(fuzzer_pid)? {
break;
}
if let Some(proc_info) = system::proc_info(fuzzer_pid)? {
event!(process_stats;