Skip to main content

Monitor metrics in a real-time time-series line-graph (a-la perfmon.exe)

Project description

grafmon

Monitor metrics in a real-time time-series line-graph

screenshot

Demonstration video

demo video

Features

  • Real-time time-series graph of metrics.
  • Provide your own metric command.
  • Several built-in metrics.
  • Polished graph interface.
  • Adjustable refresh rate.
  • Pausable updates.
  • Hide/show lines.
  • Clickable/hoverable lines.
  • Remembers window position/layout.

Install

pip install grafmon

Usage

usage: grafmon [-h] [-m MONITOR | -c COMMAND] [-r REFRESHRATE] [-t MAXTICKS]
               [-l MAXLABELS] [--list-monitors]

Monitor metrics in a real-time time-series graph

options:
  -h, --help            show this help message and exit
  -m MONITOR, --monitor MONITOR
                        Select from builtin monitors to feed data into monitor
                        [default: pcpu]
  -c COMMAND, --command COMMAND
                        User command to feed data into monitor [example: ps
                        -eo rss,pid,comm --no-headers]
  -r REFRESHRATE, --refreshrate REFRESHRATE
                        Refresh rate in milliseconds [default: 1000]
  -t TICKS, --ticks TICKS
                        Count of ticks on X axis [default: 60]
  -l LABELS, --labels LABELS
                        Count of labels on X axis [default: 10]
  --list-monitors       List available builtin monitors

Builtin monitors

avgpcpu    Average CPU% (using `ps`) over lifetime of all processes
cuc        CPU%, including dead children, in extended ##.### format of all processes
cuu        CPU% in extended ##.### format of all processes
drs        Data resident set size of all processes
pcpu       Immediate CPU% (using `top`) of all processes
pmem       Physical memory percentage of all processes
pss        Proportional share size of all processes
rbytes     Number of bytes really fetched from storage layer of all processes
rchars     Number of bytes read from storage of all processes
rops       Number of read I/O operations of all processes
rss        Resident set size (physical memory usage, in kilobytes) of all processes
sz         Physical pages used of all processes
thcount    Thread counts of all processes
trs        Text resident set (executable code memory usage) of all processes
vsz        Virtual memory usage of all processes
wbytes     Number of bytes really written to storage layer of all processes
wcbytes    Number of canceled write bytes of all processes
wchars     Number of bytes written to storage of all processes
wops       Number of write I/O operations of all processes

Custom monitor

Grafmon is not limited to the builtin monitors. Grafmon also accepts user-provided commands for monitoring. Grafmon can monitor smart plug metrics to track power usage of appliances. Grafmon can monitor IoT sensors and more!

The command must output lines in the format of <float> <string> to STDOUT. The <float> will be the value associated with <string>. The <string> may contain spaces. Grafmon will invoke the command every refresh-rate tick. It may be necessary to write a small wrapper script to convert the data to the correct formatting.

Examples:

grafmon -c 'ps -eo pcpu,pid,comm --no-headers'

grafmon -c 'cat file_regularly_overwritten'

grafmon -c 'socat TCP-LISTEN:13510 -'

Notes

I needed an easy-to-install app that can graph in real-time various system metrics, notably percentages of CPU usages for all active processes. The KDE and Gnome system monitors/task managers graphed overall CPU usage rather than per-process usage.

Grafmon is inspired in part by Windows' perfmon.exe. The graph does not scroll, but instead updates in a horizontally rolling blind. A vertical line will move from left-to-right as the metrics are read each tick. When the line reaches the end, it resets back to the beginning. This allows easy hovering over of graph elements to inspect the data. A moving scrolling graph would be more difficult to hover over the lines and their peaks.

Lines may be clicked on to highlight them to more easily see them in the graph. Lines may be hovered-over to see a tooltip of their values. Their values will also appear in the status bar at the bottom of the window.

To zoom the graph in to inspect lower valued lines, you can untick the checkboxes in the list on the left. Unticking checkboxes for lines with the highest peaks will hide the lines and the graph will zoom in to fit the next highest peaks.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grafmon-1.0.1.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grafmon-1.0.1-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file grafmon-1.0.1.tar.gz.

File metadata

  • Download URL: grafmon-1.0.1.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for grafmon-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1b80ffc4ed2ff120a314f3b6f0892903dc2b626ecad8112b3a99d160c96e4b08
MD5 fe5b66bac13bedfd1b11d743484d1281
BLAKE2b-256 0060906fc526db1101772c7df71dfc349567e5449297873744652c339d042694

See more details on using hashes here.

File details

Details for the file grafmon-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: grafmon-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for grafmon-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b56e760f0197eef17eaf30edc10aaefdfc7c24d1b6c497a32b9a154f2193e18
MD5 80c736b8398c9067c12cf2d591fd6fdc
BLAKE2b-256 9e1b3f4f2a48ae2d5f27de06776f66dd0bfbd74c37bb28d277960564decde5b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page