Skip to content

Conversation

@tallpsmith
Copy link
Contributor

@tallpsmith tallpsmith commented Dec 4, 2025

At the moment, pmstat on macOS is quite lean on what it can show because some metrics are not available (yet).

I've modified pmstat so that it (optionally) hides columns that are not available.

I held several sessions with Claude Code to get here because it's certainly better at C than I am... After some back and forth I narrowed in on the -C and --compact mode for pmstat which seemed to not conflict with any other pm-tool that Claude looked at (and my fuzzy memory). I elected to make this compact mode optional, and not default, just to maintain backwards compatibility. There's certainly a 'brain freeze' moment when one runs pmstat and sees a lot of columns missing, so I wondered if it was better to maintain the original layout (with missing metrics) as the default for us old folks...

This goes towards #2303

…ty of metrics.

Pretty close, but column data is shifted right by a single column.

This used Claude Code. (Even AI gets off-by-one errors?)
@tallpsmith tallpsmith added the macOS For issues specific or related to macOS label Dec 5, 2025
@tallpsmith tallpsmith requested a review from natoscott December 7, 2025 05:37
This change adds optional dynamic column hiding to pmstat, allowing it
to automatically suppress columns for metrics that are unavailable on
the current platform.

This is particularly useful for macOS and other platforms where some
Linux-specific metrics (like swap in/out, buffer memory, etc.) don't
exist. Instead of showing "?" for missing values, the columns are
simply not displayed.

Usage:
  pmstat          # Default: show all columns (original behavior)
  pmstat -C       # Compact: hide unavailable metric columns

Note: This commit is part of separating cross-platform tool improvements
from platform-specific PMDA enhancements. Darwin PMDA swap metrics have
been split into a separate PR for the macOS-specific enhancement branch.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@tallpsmith tallpsmith force-pushed the pmstat_dynamic_columns branch from 1443c0c to c6bad09 Compare January 1, 2026 23:20
@tallpsmith tallpsmith changed the title Add macOS Swap metrics and allow pmstat to auto-hide unavailable columns Allow pmstat to auto-hide unavailable columns Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macOS For issues specific or related to macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant