socktop_agent: bump version to 1.40.65
This commit is contained in:
parent
eed346abb6
commit
61fe1cc38e
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -2187,7 +2187,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "socktop_agent"
|
||||
version = "1.40.64"
|
||||
version = "1.40.65"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"assert_cmd",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "socktop_agent"
|
||||
version = "1.40.64"
|
||||
version = "1.40.65"
|
||||
authors = ["Jason Witty <jasonpwitty+socktop@proton.me>"]
|
||||
description = "Remote system monitor over WebSocket, TUI like top"
|
||||
edition = "2021"
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user