feat: process list

this is unnacceptably unperformant;
I think I've reached the point at which sysinfo doesn't do what I want,
which is keep track of a table of processes efficiently enough.
This commit is contained in:
electria 2026-08-18 14:05:36 -07:00
commit b20158820b
Signed by: electria
SSH key fingerprint: SHA256:8LlB3ucPbBHqozqkhsNbaV5oG3SlzzqUj8FZDL6IPQs
4 changed files with 105 additions and 22 deletions

View file

@ -2,13 +2,11 @@ use std::{io::Write, thread};
use ron::{Error, ser};
use crate::sysinfo_snapshot::SysinfoSnapshot;
use crate::sysinfo_snapshot::{self, SysinfoSnapshot};
pub fn run() -> Result<(), Error> {
let mut sys = sysinfo::System::new();
let refreshes = sysinfo::RefreshKind::nothing()
.with_memory(sysinfo::MemoryRefreshKind::everything())
.with_cpu(sysinfo::CpuRefreshKind::nothing().with_cpu_usage());
let refreshes = sysinfo_snapshot::refreshes();
sys.refresh_specifics(refreshes);
thread::sleep(sysinfo::MINIMUM_CPU_UPDATE_INTERVAL);