clippy code clean up
clippy code clean up
This commit is contained in:
@@ -1,24 +1,16 @@
|
||||
//! Shared agent state: sysinfo handles and hot JSON cache.
|
||||
|
||||
use std::sync::atomic::AtomicUsize;
|
||||
use std::{collections::HashMap, sync::Arc};
|
||||
use sysinfo::{Components, Disks, Networks, System};
|
||||
use std::sync::Arc;
|
||||
use sysinfo::System;
|
||||
use tokio::sync::{Mutex, Notify, RwLock};
|
||||
|
||||
pub type SharedSystem = Arc<Mutex<System>>;
|
||||
pub type SharedNetworks = Arc<Mutex<Networks>>;
|
||||
pub type SharedTotals = Arc<Mutex<HashMap<String, (u64, u64)>>>;
|
||||
pub type SharedComponents = Arc<Mutex<Components>>;
|
||||
pub type SharedDisks = Arc<Mutex<Disks>>;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct AppState {
|
||||
// Persistent sysinfo handles
|
||||
pub sys: SharedSystem,
|
||||
pub nets: SharedNetworks,
|
||||
pub net_totals: SharedTotals, // iface -> (rx_total, tx_total)
|
||||
pub components: SharedComponents,
|
||||
pub disks: SharedDisks,
|
||||
|
||||
// Last serialized JSON snapshot for fast WS responses
|
||||
pub last_json: Arc<RwLock<String>>,
|
||||
|
||||
Reference in New Issue
Block a user