From 61fe1cc38eed501553cd9e087504d14210bc7073 Mon Sep 17 00:00:00 2001 From: jasonwitty Date: Thu, 28 Aug 2025 12:27:48 -0700 Subject: [PATCH] socktop_agent: bump version to 1.40.65 --- Cargo.lock | 2 +- socktop_agent/Cargo.toml | 2 +- socktop_agent/src/metrics.rs | 18 ------------------ 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 62f1988..84da1ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2187,7 +2187,7 @@ dependencies = [ [[package]] name = "socktop_agent" -version = "1.40.64" +version = "1.40.65" dependencies = [ "anyhow", "assert_cmd", diff --git a/socktop_agent/Cargo.toml b/socktop_agent/Cargo.toml index 2ce5efd..3589a21 100644 --- a/socktop_agent/Cargo.toml +++ b/socktop_agent/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "socktop_agent" -version = "1.40.64" +version = "1.40.65" authors = ["Jason Witty "] description = "Remote system monitor over WebSocket, TUI like top" edition = "2021" diff --git a/socktop_agent/src/metrics.rs b/socktop_agent/src/metrics.rs index 6e3d74c..a758f50 100644 --- a/socktop_agent/src/metrics.rs +++ b/socktop_agent/src/metrics.rs @@ -418,24 +418,6 @@ pub async fn collect_processes_all(state: &AppState) -> ProcessesPayload { // Single efficient refresh with optimized CPU collection let (total_count, procs) = { let mut sys = state.sys.lock().await; - // Get load first for TTL calculation - let load = sys.global_cpu_usage(); - - // Adaptive TTL based on system load - will be used for next cache cycle - let ttl_ms: u64 = if let Ok(v) = std::env::var("SOCKTOP_AGENT_PROCESSES_TTL_MS") { - v.parse().unwrap_or(2_000) - } else { - // Adaptive TTL: longer when system is idle - if load < 10.0 { - 5_000 // Very light load - } else if load < 30.0 { - 3_000 // Light load - } else if load < 50.0 { - 2_000 // Medium load - } else { - 1_000 // High load - } - }; let kind = ProcessRefreshKind::nothing().with_memory(); // Optimize refresh strategy based on system load