Files
glances-rs/README.md
T
glances-rs ea9debf71b containers: Docker (and best-effort Podman) plugin
- minimal Docker Engine API client over Unix/TCP sockets with version
  negotiation and chunked response decoding
- drop-in stats schema: active/stopped containers, CPU/memory/IO/network
  rates, ports, uptime (pretty_date), image, engine field
- Docker + Podman engines, config (all, podman_sock, max_name_size,
  disable_stats, show/hide, per-container thresholds)
- export strips the computation sub-dicts (--stdout/--stdout-csv)
- TUI block above the process count
- CI-safe fake Docker socket test + live differential parity
2026-10-10 00:24:39 +00:00

2.9 KiB

glances-rs

A Rust rewrite of Glances, the system monitoring tool, targeting Linux.

This project is a drop-in replacement for the standalone Glances modes:

  • curses-like terminal UI (glances)
  • stdout modes: --stdout, --stdout-csv, --stdout-json
  • --fetch (with the shipped templates), --issue, --module-list
  • the same glances.conf configuration file (limits, thresholds, aliases, show/hide lists, per-plugin refresh, history, actions)
  • compatible stats schemas and CLI flags for the implemented features

The following Python Glances features are intentionally not provided: REST API, WebUI, MCP, client/server mode, discovery/browser, SNMP and exporters.

Status

Area Status
CLI (clap, drop-in flags) done
Configuration (glances.conf) done
Plugin model (limits, views, rates, MMM, history, events, actions) done
Terminal UI (ratatui) done
stdout / CSV / JSON / fetch / issue modes done
Core plugins cpu, percpu, mem, memswap, load, fs, network, diskio, sensors, irq, system, uptime, now, core, version, psutilversion, quicklook, processcount, processlist, programlist
Extended plugins folders, amps, ports, raid, wifi, ip, containers (Docker)
Not ported yet vms, gpu/npu/mpp, connections, smart, cloud, LXD containers
Python-specific flags --trace-malloc, --api-doc, --api-restful-doc rejected with a clear error

Build and run

$ cargo build --release
$ ./target/release/glances                 # terminal UI
$ ./target/release/glances --stdout-json cpu,mem,load
$ ./target/release/glances --fetch

Differential testing

The tools/parity.py script compares the Rust implementation with the Python reference implementation (the oracle) plugin by plugin: it runs both for a few refreshes and diffs the flattened key sets and value types.

$ python3 -m venv /tmp/opencode/glances-py
$ /tmp/opencode/glances-py/bin/pip install /path/to/python-glances
$ cargo build
$ python3 tools/parity.py            # all implemented plugins
$ python3 tools/parity.py cpu mem    # selected plugins

The containers plugin is compared against a live Docker daemon. Install the Python extras (pip install docker python-dateutil requests) and have a running container; the harness gives the plugin six refreshes because both implementations need a warm-up sample before their rates are available. Use a config with [containers] all=True to also compare stopped containers.

Workspace layout

Crate Purpose
glances-core plugin model, config, limits, history, events, filters, processes
glances-plugins collectors, plugin registry and update engine
glances-tui terminal UI (ratatui)
glances-cli the glances binary, stdout modes and fetch renderer

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.