performance improvements and formatting cleanup

This commit is contained in:
2025-08-11 22:37:46 -07:00
parent c3f81eef25
commit d69a4104fc
10 changed files with 141 additions and 75 deletions
+4 -1
View File
@@ -54,12 +54,15 @@ async fn main() {
let state = AppState {
sys: Arc::new(Mutex::new(sys)),
last_json: Arc::new(RwLock::new(String::new())),
components: Arc::new(Mutex::new(components)),
disks: Arc::new(Mutex::new(disks)),
networks: Arc::new(Mutex::new(nets)),
// new: adaptive sampling controls
client_count: Arc::new(AtomicUsize::new(0)),
wake_sampler: Arc::new(Notify::new()),
auth_token: std::env::var("SOCKTOP_TOKEN")
.ok()
.filter(|s| !s.is_empty()),
.filter(|s| !s.is_empty())
};
// Start background sampler (adjust cadence as needed)