Skip to main content

PGauge

PGauge is a command-line utility for macOS that parses power metrics from the powermetrics command and displays them in a user-friendly format. It provides real-time CPU and GPU power usage statistics, helping you monitor your system's performance efficiently.

Motivation

While there are existing alternatives like MX Power Gadget, I found that they consume a significant amount of system resources themselves (investigation in russian), which defeats the purpose of lightweight power monitoring. PGauge was developed as a more efficient solution that minimizes resource usage while providing accurate power metrics.

Features

  • Real-time monitoring: Shows up-to-date statistics on CPU and GPU power usage.
  • Summary Statistics: Shows minimum and maximum values over a specified period.
  • History Keeping: Provides an option to keep a history of all updates.
  • Automatic Terminal Resizing: Adjusts the terminal window size for optimal display.

Requirements

  • Operating System: macOS (Apple Silicon and Intel)
  • Permissions: Administrator privileges (requires admin password)
  • Python Version: Python 3.8 or higher

Installation

Install PGauge using pip:

pip install pgauge

Alternatively:

python3 -m pip install pgauge

Usage

pgauge [-h] [-i mS] [-s S] [-k] [-r WxH]

Alternatively, you can run PGauge as a Python module:

python3 -m pgauge [-h] [-i mS] [-s S] [-k] [-r WxH]

Optional Arguments

  • -h, --help
    Show the help message and exit.

  • -i mS, --interval mS
    Set the stats update interval in milliseconds. Default is 1000 (one second).

  • -s S, --summary S
    Display the minimum and maximum values for a period in seconds. Set to 0 to disable history. Default is 60 (one minute).

  • -k, --keep-history
    Print each update on a new line instead of refreshing the current line.

  • -r WxH, --resize WxH
    Resize the terminal window to the specified width and height (WxH). You can also set it to auto for automatic resizing.

Examples

  • Run with Default Settings

    pgauge
    
  • Set Update Interval to 500ms

    pgauge -i 500
    
  • Disable Summary History

    pgauge -s 0
    
  • Keep History of All Updates

    pgauge -k
    
  • Automatically Resize Terminal Window

    pgauge -r auto
    

Important Notes

  • Administrator Privileges Required: PGauge uses the powermetrics command, which requires administrator privileges. You will be prompted for your admin password when running pgauge. You can grant privileges for the current user to run powermetrics without a password by running the following command:

    echo `whoami` "ALL=(ALL) NOPASSWD: /usr/bin/powermetrics *" | sudo tee /etc/sudoers.d/powermetrics
    

Metadata

Release files for pgauge 0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pgauge 0.7
File Interpreter ABI Platform
pgauge-0.7-py3-none-any.whl Python 3 none any Details

Release files / pgauge-0.7-py3-none-any.whl

Download URL pgauge-0.7-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2fa552288e8654fe492fb46f0fe3d1a3253fec5830743ec49b55b189b4ec62e6
BLAKE2b-256 checksum
How to use checksums
1bbe548a4b32e645188555b8fb5cdd9a4752000d2460690ccdf454684a32902d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release history Release notifications | RSS feed

This release

0.7 This release

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page