clippy clean up multiple files
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
//! socktop agent entrypoint: sets up sysinfo handles, launches a sampler,
|
||||
//! and serves a WebSocket endpoint at /ws.
|
||||
|
||||
mod gpu;
|
||||
mod metrics;
|
||||
mod sampler;
|
||||
mod state;
|
||||
mod types;
|
||||
mod ws;
|
||||
mod gpu;
|
||||
|
||||
use axum::{routing::get, Router};
|
||||
use std::{ net::SocketAddr, sync::atomic::AtomicUsize, sync::Arc, time::Duration,
|
||||
};
|
||||
use std::{net::SocketAddr, sync::atomic::AtomicUsize, sync::Arc, time::Duration};
|
||||
|
||||
use sysinfo::{
|
||||
Components, CpuRefreshKind, Disks, MemoryRefreshKind, Networks, ProcessRefreshKind,
|
||||
RefreshKind, System,
|
||||
|
||||
@@ -41,7 +41,11 @@ pub async fn collect_metrics(state: &AppState) -> Metrics {
|
||||
components.refresh(true);
|
||||
components.iter().find_map(|c| {
|
||||
let l = c.label().to_ascii_lowercase();
|
||||
if l.contains("cpu") || l.contains("package") || l.contains("tctl") || l.contains("tdie") {
|
||||
if l.contains("cpu")
|
||||
|| l.contains("package")
|
||||
|| l.contains("tctl")
|
||||
|| l.contains("tdie")
|
||||
{
|
||||
c.temperature()
|
||||
} else {
|
||||
None
|
||||
|
||||
@@ -45,7 +45,9 @@ impl AppState {
|
||||
last_json: Arc::new(RwLock::new(String::new())),
|
||||
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()),
|
||||
auth_token: std::env::var("SOCKTOP_TOKEN")
|
||||
.ok()
|
||||
.filter(|s| !s.is_empty()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user