2 releases

Uses new Rust 2024

new 0.1.1 Feb 21, 2026
0.1.0 Feb 20, 2026

#380 in Database interfaces

BSD-3-Clause

53KB
1K SLoC

Rust 1K SLoC // 0.0% comments Python 155 SLoC // 0.2% comments

pgmon

A PostgreSQL monitoring TUI inspired by pg_activity.

Features

  • Real-time views of:
    • pg_stat_activity
    • pg_stat_database
    • pg_locks
    • pg_stat_io (PostgreSQL 16+)
    • pg_stat_statements (if extension exists)
  • Interactive TUI (Tabs, Table navigation)
  • Configurable refresh rate and top-N rows.

Installation

cargo build --release

Usage

pgmon --dsn "postgresql://user:password@localhost:5432/postgres"

# Specific home view and sort
pgmon --dsn "..." --home-view statements --sort total_time --top-n 20 --refresh-ms 2000

CLI Options

  • -d, --dsn <STRING>: PostgreSQL connection string (required)
  • -r, --refresh-ms <u64>: Refresh interval (default: 1000)
  • -n, --top-n <u32>: Rows to show (default: 10)
  • --home-view <activity|statements>: Initial view
  • -v: Verbose logging

Dependencies

~24–44MB
~606K SLoC