remove unused import. / clippy cleanup
This commit is contained in:
parent
0210b49219
commit
47eff3a75c
@ -1,7 +1,5 @@
|
|||||||
//! Metrics collection using sysinfo for socktop_agent.
|
//! Metrics collection using sysinfo for socktop_agent.
|
||||||
|
|
||||||
use std::fs;
|
|
||||||
|
|
||||||
use crate::gpu::collect_all_gpus;
|
use crate::gpu::collect_all_gpus;
|
||||||
use crate::state::AppState;
|
use crate::state::AppState;
|
||||||
use crate::types::{
|
use crate::types::{
|
||||||
@ -12,6 +10,8 @@ use once_cell::sync::OnceCell;
|
|||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
|
use std::fs;
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
@ -802,8 +802,9 @@ fn enumerate_child_processes_lightweight(
|
|||||||
// On non-Linux, we have to iterate through all processes in sysinfo
|
// On non-Linux, we have to iterate through all processes in sysinfo
|
||||||
// This is less efficient but maintains cross-platform compatibility
|
// This is less efficient but maintains cross-platform compatibility
|
||||||
for (child_pid, child_process) in system.processes() {
|
for (child_pid, child_process) in system.processes() {
|
||||||
if let Some(parent) = child_process.parent() {
|
if let Some(parent) = child_process.parent()
|
||||||
if parent.as_u32() == parent_pid {
|
&& parent.as_u32() == parent_pid
|
||||||
|
{
|
||||||
let child_info = DetailedProcessInfo {
|
let child_info = DetailedProcessInfo {
|
||||||
pid: child_pid.as_u32(),
|
pid: child_pid.as_u32(),
|
||||||
name: child_process.name().to_string_lossy().to_string(),
|
name: child_process.name().to_string_lossy().to_string(),
|
||||||
@ -841,7 +842,6 @@ fn enumerate_child_processes_lightweight(
|
|||||||
children.push(child_info);
|
children.push(child_info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
children
|
children
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user