M4: fetch mode, cleanup and documentation
- --fetch with a Jinja-subset renderer and the shipped templates - clippy clean, cargo fmt, all tests green - README status and differential testing instructions
This commit is contained in:
@@ -7,24 +7,60 @@ 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`, `--issue`, `--modules-list`
|
||||
- all plugins, including extended ones (containers, GPUs, sensors, ...)
|
||||
- the same `glances.conf` configuration file
|
||||
- `--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.
|
||||
REST API, WebUI, MCP, client/server mode, discovery/browser, SNMP and
|
||||
exporters.
|
||||
|
||||
## Status
|
||||
|
||||
Work in progress. See the milestones in the project plan; the workspace is
|
||||
organized as:
|
||||
| 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 |
|
||||
| Not ported yet | containers, vms, gpu/npu/mpp, connections, smart, cloud |
|
||||
| Python-specific flags | `--trace-malloc`, `--api-doc`, `--api-restful-doc` rejected with a clear error |
|
||||
|
||||
## Build and run
|
||||
|
||||
```console
|
||||
$ 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.
|
||||
|
||||
```console
|
||||
$ 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
|
||||
```
|
||||
|
||||
## Workspace layout
|
||||
|
||||
| Crate | Purpose |
|
||||
| --- | --- |
|
||||
| `glances-core` | plugin model, config, limits, history, events, filters, output |
|
||||
| `glances-plugins` | collectors and plugin registry/engine |
|
||||
| `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 |
|
||||
| `glances-cli` | the `glances` binary, stdout modes and fetch renderer |
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Reference in New Issue
Block a user