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

View file

@ -8,7 +8,10 @@ use iced::{
use ron::de;
use smol::{Timer, unblock};
use crate::{app, sysinfo_snapshot::SysinfoSnapshot};
use crate::{
app,
sysinfo_snapshot::{self, SysinfoSnapshot},
};
pub fn create() -> Task<app::Message> {
if env::args()
@ -43,9 +46,7 @@ pub fn create() -> Task<app::Message> {
1,
async |mut sender: futures::channel::mpsc::Sender<SysinfoSnapshot>| {
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);
Timer::after(sysinfo::MINIMUM_CPU_UPDATE_INTERVAL).await;