2025-08-08 08:03:35 +00:00
|
|
|
[package]
|
|
|
|
|
name = "socktop_agent"
|
2025-08-28 23:03:05 +00:00
|
|
|
version = "1.40.67"
|
2025-08-08 08:03:35 +00:00
|
|
|
authors = ["Jason Witty <jasonpwitty+socktop@proton.me>"]
|
|
|
|
|
description = "Remote system monitor over WebSocket, TUI like top"
|
|
|
|
|
edition = "2021"
|
2025-08-11 19:10:40 +00:00
|
|
|
license = "MIT"
|
2025-08-25 00:56:22 +00:00
|
|
|
readme = "README.md"
|
2025-08-08 08:03:35 +00:00
|
|
|
|
|
|
|
|
[dependencies]
|
|
|
|
|
tokio = { version = "1", features = ["full"] }
|
|
|
|
|
axum = { version = "0.7", features = ["ws", "macros"] }
|
2025-08-12 03:47:21 +00:00
|
|
|
sysinfo = { version = "0.37", features = ["network", "disk", "component"] }
|
2025-08-08 08:03:35 +00:00
|
|
|
serde = { version = "1", features = ["derive"] }
|
|
|
|
|
serde_json = "1"
|
multiple feature and performance improvements (see description)
Here are concise release notes you can paste into your GitHub release.
Release notes — 2025-08-12
Highlights
Agent back to near-zero CPU when idle (request-driven, no background samplers).
Accurate per-process CPU% via /proc deltas; only top-level processes (threads hidden).
TUI: processes pane gets scrollbar, click-to-sort (CPU% or Mem) with indicator, stable total count.
Network panes made taller; disks slightly reduced.
README revamped: rustup prereqs, crates.io install, update/systemd instructions.
Clippy cleanups across agent and client.
Agent
Reverted precompressed caches and background samplers; WebSocket path is request-driven again.
Ensured on-demand gzip for larger replies; no per-request overhead when small.
Processes: switched to refresh_processes_specifics with ProcessRefreshKind::everything().without_tasks() to exclude threads.
Per-process CPU% now computed from /proc jiffies deltas using a small ProcCpuTracker (fixes “always 0%”/scaling issues).
Optional metrics and light caching:
CPU temp and GPU metrics gated by env (SOCKTOP_AGENT_TEMP=0, SOCKTOP_AGENT_GPU=0).
Tiny TTL caches via once_cell to avoid rescanning sensors every tick.
Dependencies: added once_cell = "1.19".
No API changes to WS endpoints.
Client (TUI)
Processes pane:
Scrollbar (mouse wheel, drag; keyboard arrows/PageUp/PageDown/Home/End).
Click header to sort by CPU% or Mem; dot indicator on active column.
Preserves process_count across fast metrics updates to avoid flicker.
UI/theme:
Shared scrollbar colors moved to ui/theme.rs; both CPU and Processes reuse them.
Cached pane rect to fix input handling; removed unused vars.
Layout: network download/upload get more vertical space; disks shrink slightly.
Clippy fixes: derive Default for ProcSortBy; style/import cleanups.
Docs
README: added rustup install steps (with proper shell reload), install via cargo install socktop and cargo install socktop_agent, and a clear Updating section (systemd service steps included).
Features list updated; roadmap marks independent cadences as done.
Upgrade notes
Agent: cargo install socktop_agent --force, then restart your systemd service; if unit changed, systemctl daemon-reload.
TUI: cargo install socktop --force.
Optional envs to trim overhead: SOCKTOP_AGENT_GPU=0, SOCKTOP_AGENT_TEMP=0.
No config or API breaking changes.
2025-08-12 22:52:46 +00:00
|
|
|
flate2 = { version = "1", default-features = false, features = ["rust_backend"] }
|
Major refactor, additional comments, performance improvements, idle performance improvements, access token, port specification
Release highlights
Introduced split client/agent architecture with a ratatui-based TUI and a lightweight WebSocket agent.
Added adaptive (idle-aware) sampler: agent samples fast only when clients are connected; sleeps when idle.
Implemented metrics JSON caching for instant ws replies; cold-start does one-off collection.
Port configuration: --port/-p, positional PORT, or SOCKTOP_PORT env (default 3000).
Optional token auth: SOCKTOP_TOKEN on agent, ws://HOST:PORT/ws?token=VALUE in client.
Logging via tracing with RUST_LOG control.
CI workflow (fmt, clippy, build) for Linux and Windows.
Systemd unit example for always-on agent.
TUI features
CPU: overall sparkline + per-core history with trend arrows and color thresholds.
Memory/Swap gauges with humanized labels.
Disks panel with per-device usage and icons.
Network download/upload sparklines (KB/s) with peak tracking.
Top processes table (PID, name, CPU%, mem, mem%).
Header with hostname and CPU temperature indicator.
Agent changes
sysinfo 0.36.1 targeted refresh: refresh_cpu_all, refresh_memory, refresh_processes_specifics(ProcessesToUpdate::All, ProcessRefreshKind::new().with_cpu().with_memory(), true).
WebSocket handler: client counting with wake notifications, cold-start handling, proper Response returns.
Sampler uses MissedTickBehavior::Skip to avoid catch-up bursts.
Docs
README updates: running instructions, port configuration, optional token auth, platform notes, example JSON.
Added socktop-agent.service systemd unit.
Platform notes
Linux (AMD/Intel) supported; tested on AMD, targeting Intel next.
Raspberry Pi supported (availability of temps varies by model).
Windows builds/run; CPU temperature may be unavailable (shows N/A).
Known/next
Roadmap includes configurable refresh interval, TUI filtering/sorting, TLS/WSS, and export to file.
Add Context...
README.md
2025-08-08 19:41:32 +00:00
|
|
|
futures-util = "0.3.31"
|
|
|
|
|
tracing = "0.1"
|
2025-08-11 19:04:55 +00:00
|
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
2025-08-24 19:08:52 +00:00
|
|
|
# nvml-wrapper removed (unused; GPU metrics via gfxinfo only now)
|
multiple feature and performance improvements (see description)
Here are concise release notes you can paste into your GitHub release.
Release notes — 2025-08-12
Highlights
Agent back to near-zero CPU when idle (request-driven, no background samplers).
Accurate per-process CPU% via /proc deltas; only top-level processes (threads hidden).
TUI: processes pane gets scrollbar, click-to-sort (CPU% or Mem) with indicator, stable total count.
Network panes made taller; disks slightly reduced.
README revamped: rustup prereqs, crates.io install, update/systemd instructions.
Clippy cleanups across agent and client.
Agent
Reverted precompressed caches and background samplers; WebSocket path is request-driven again.
Ensured on-demand gzip for larger replies; no per-request overhead when small.
Processes: switched to refresh_processes_specifics with ProcessRefreshKind::everything().without_tasks() to exclude threads.
Per-process CPU% now computed from /proc jiffies deltas using a small ProcCpuTracker (fixes “always 0%”/scaling issues).
Optional metrics and light caching:
CPU temp and GPU metrics gated by env (SOCKTOP_AGENT_TEMP=0, SOCKTOP_AGENT_GPU=0).
Tiny TTL caches via once_cell to avoid rescanning sensors every tick.
Dependencies: added once_cell = "1.19".
No API changes to WS endpoints.
Client (TUI)
Processes pane:
Scrollbar (mouse wheel, drag; keyboard arrows/PageUp/PageDown/Home/End).
Click header to sort by CPU% or Mem; dot indicator on active column.
Preserves process_count across fast metrics updates to avoid flicker.
UI/theme:
Shared scrollbar colors moved to ui/theme.rs; both CPU and Processes reuse them.
Cached pane rect to fix input handling; removed unused vars.
Layout: network download/upload get more vertical space; disks shrink slightly.
Clippy fixes: derive Default for ProcSortBy; style/import cleanups.
Docs
README: added rustup install steps (with proper shell reload), install via cargo install socktop and cargo install socktop_agent, and a clear Updating section (systemd service steps included).
Features list updated; roadmap marks independent cadences as done.
Upgrade notes
Agent: cargo install socktop_agent --force, then restart your systemd service; if unit changed, systemctl daemon-reload.
TUI: cargo install socktop --force.
Optional envs to trim overhead: SOCKTOP_AGENT_GPU=0, SOCKTOP_AGENT_TEMP=0.
No config or API breaking changes.
2025-08-12 22:52:46 +00:00
|
|
|
gfxinfo = "0.1.2"
|
2025-08-16 08:23:20 +00:00
|
|
|
once_cell = "1.19"
|
|
|
|
|
axum-server = { version = "0.6", features = ["tls-rustls"] }
|
|
|
|
|
rustls = "0.23"
|
|
|
|
|
rustls-pemfile = "2.1"
|
2025-08-22 17:46:29 +00:00
|
|
|
rcgen = "0.13" # pure-Rust self-signed cert generation (replaces openssl vendored build)
|
2025-08-16 08:23:20 +00:00
|
|
|
anyhow = "1"
|
|
|
|
|
hostname = "0.3"
|
2025-08-20 06:24:36 +00:00
|
|
|
prost = { workspace = true }
|
2025-08-22 19:43:48 +00:00
|
|
|
time = { version = "0.3", default-features = false, features = ["formatting", "macros", "parsing" ] }
|
2025-08-20 06:24:36 +00:00
|
|
|
|
|
|
|
|
[build-dependencies]
|
|
|
|
|
prost-build = "0.13"
|
|
|
|
|
tonic-build = { version = "0.12", default-features = false, optional = true }
|
|
|
|
|
protoc-bin-vendored = "3"
|
2025-08-16 08:23:20 +00:00
|
|
|
[dev-dependencies]
|
|
|
|
|
assert_cmd = "2.0"
|
2025-08-28 19:03:45 +00:00
|
|
|
tempfile = "3.10"
|
2025-08-28 23:03:05 +00:00
|
|
|
tokio-tungstenite = "0.21"
|