Skip to content

Conversation

@rubenszinho
Copy link

Closes #242

Adds a new railway metrics command to view service resource usage (CPU, Memory, Network) with both static table and live TUI modes.

New Command

  • railway metrics - Display resource metrics for all services.
  • --service <name> - Filter by specific service.
  • --time <1h|6h|12h|1d|3d|7d> - Historical time range (default: 1h).
  • --raw - JSON output for scripting.
  • --watch / -w - Live-updating TUI mode.

Features

  • Alphabetical service ordering
  • Live updates every 5 seconds.
  • Keyboard navigation (/, Tab, q to quit).
  • Sparkline charts with units (%, GB, MB).
  • Error display in header when API calls fail.
  • Color-coded CPU usage and human-readable units.

Development Environment

Updated Nix configuration to support newer Cargo features:

  • Added rustup to flake.nix and shell.nix.
  • Required for edition2024 feature used by dependencies.
  • Fixes compatibility with newer crate versions.

cargo run -- metrics --watch
image

cargo run -- metrics
image

cargo run -- metrics --time 6h
image

cargo run -- metrics --raw
image

@brody192 brody192 added the release/minor Author minor release label Jan 26, 2026
@brody192 brody192 requested a review from Milo123459 January 26, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/minor Author minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI Metrics

2 participants