Skip to content

feat(discordsh): add real-time health monitoring with sysinfo (Phase 3)#7223

Merged
h0lybyte merged 1 commit intodevfrom
trunk/discordsh-health-02-24-2026
Feb 24, 2026
Merged

feat(discordsh): add real-time health monitoring with sysinfo (Phase 3)#7223
h0lybyte merged 1 commit intodevfrom
trunk/discordsh-health-02-24-2026

Conversation

@h0lybyte
Copy link
Copy Markdown
Member

Summary

  • Add HealthMonitor module with background 60s polling for CPU, memory, threads, and process metrics via sysinfo 0.38.2
  • Wire shared Arc<HealthMonitor> into both Discord bot (Data) and Axum HTTP server (HttpState)
  • /health slash command now shows rich embed with health thresholds (Healthy/Warning/Critical), memory bar, CPU, threads, PID, and uptime
  • /status embed gains conditional health fields (Memory, CPU, Threads, Health) when data is available
  • HTTP /health endpoint returns JSON with full system metrics instead of plain "OK"
  • Refresh button calls force_refresh() for immediate metric update before re-rendering

Test plan

  • cargo build -p axum-discordsh — zero errors
  • cargo clippy -p axum-discordsh — clean (only pre-existing warnings in other modules)
  • cargo test -p axum-discordsh — 21/21 pass (5 new health tests + 16 existing)
  • rustfmt --check — clean, passes pre-commit hook
  • pnpm nx e2e discordsh — Docker build (requires OrbStack running)
  • Manual: /status shows Memory, CPU, Threads, Health fields
  • Manual: /health shows detailed health embed with thresholds
  • Manual: Refresh button triggers force_refresh() and updates embed
  • Manual: curl localhost:4321/health returns JSON with status: "ok" and health metrics

🤖 Generated with Claude Code

Add HealthMonitor with background 60s polling for CPU, memory, threads,
and process metrics via sysinfo 0.38.2. Wire shared Arc<HealthMonitor>
into both Discord bot and Axum HTTP server. /health command shows rich
embed with status thresholds (Healthy/Warning/Critical), /status embed
gains health fields, HTTP /health returns JSON with system metrics, and
Refresh button triggers immediate force_refresh().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant