Add process view
CI / test (push) Successful in 1m1s
Release rolling / release (push) Successful in 7m12s

This commit is contained in:
Raven Scott
2026-07-19 15:41:35 -04:00
parent 2923678354
commit f604d210c3
20 changed files with 2215 additions and 6 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ Live retention is edited in the desktop **Settings → Data** tab (admin) and pe
| `PEARDATA_SENSORS` | on (Linux) | `0` disables hwmon/thermal charts |
| `PEARDATA_DISK_PARTITIONS` | off | `1` charts partition devices (higher cardinality) |
| `PEARDATA_IRQ_MAX` | `24` | Max per-IRQ interrupt charts |
| `PEARDATA_PROCESSES` | off | `1` enables process top CPU/RSS/IO/threads |
| `PEARDATA_PROCESSES` | **on** (Linux) | Top process charts (`processes.top_*`). Set `0` to disable. Processes **tab** works whenever `/proc` is readable |
| `PEARDATA_PROCESSES_TOP` | `8` | How many processes to keep in top charts (max 32) |
| `PEARDATA_MYSQL` | off | MySQL/MariaDB TCP probe (+ optional stats URL) |
| `PEARDATA_MYSQL_URL` | `127.0.0.1:3306` | MySQL host:port |
+1
View File
@@ -13,6 +13,7 @@ Related: [ROADMAP.md](./ROADMAP.md) Phase 6 · [DESKTOP.md](./DESKTOP.md) · [DA
|---------|--------|
| Overview | Compact 6-panel live grid + KPIs (auto-scaled RAM/net units); sparks + KPIs sync from history seed |
| Charts | Sectioned metrics wall (TOC + cards), shared time bar, multi-dim series |
| Processes | Live `/proc` table, KPIs, tree, detail drawer, CSV ([user-guide/processes.md](../user-guide/processes.md)) |
| Containers | Docker/cgroup cards use **human names** (e.g. `dozzle · CPU`); ids stay `docker.cpu.<shortId>` |
| Time | Charts presets (1m6h) + play/pause; UI thin-history advisory; agent retention via Settings → Data |
| Dimensions | Legend chips show/hide; chart type cycle (line/area/stacked/bar/pie) |
+4 -3
View File
@@ -76,9 +76,10 @@ Have `pipeline.js` start each enabled collector; all emit `samples` batches into
### Process top-N collector
1. Set `PEARDATA_PROCESSES=1` (optional `PEARDATA_PROCESSES_TOP=8`).
2. Charts: `processes.top_cpu`, `processes.top_rss` (dimensions = process comm names).
3. Linux `/proc` only; safe no-op on other platforms.
1. Default **on** for Linux (`PEARDATA_PROCESSES=0` to disable charts). Optional `PEARDATA_PROCESSES_TOP=8`.
2. Charts: `processes.top_cpu` / `top_rss` / `top_io` / `top_threads` (dimensions = process comm names).
3. Desktop **Processes** tab + RPC `listProcesses` / `GET /api/v3/processes` — per-PID live table (not just top-N charts).
4. Linux `/proc` only; safe no-op on other platforms.
### Nginx stub_status plugin
+14
View File
@@ -53,6 +53,7 @@ Auth modes at handshake: public key (viewer), capability token / `pd1.` invite,
| `queryData` | viewer | `{ chart, after, before, points, group, tier }` | Time series |
| `getWeights` | viewer | see below | Metric Correlations / alert weights |
| `queryLogs` | viewer* | see below | Anomaly / audit / journal lines |
| `listProcesses` | viewer | sort / filter / q / limit | Live Linux `/proc` process table |
| `getAllMetrics` | viewer | `{ format: json\|prometheus\|shell }` | Latest export |
\* `queryLogs` method role is viewer so anomaly search works for all dialers; **audit** and **journal** sources require **admin** inside the handler.
@@ -84,6 +85,19 @@ REST parity: `GET /api/v*/weights`. Engine: `server/services/weights.js`.
Journal is **enabled by default** on Linux (`PEARDATA_JOURNAL=0` to disable). Installer grants `systemd-journal` to the agent user. REST: `GET /api/v*/logs`. Engine: `server/services/logs.js`. UI: [user-guide/logs.md](../user-guide/logs.md).
#### `listProcesses`
| Arg | Notes |
|-----|--------|
| `sort` | `cpu` (default) \| `rss` \| `pid` \| `name` \| `io` \| `threads` \| `age` \| `fds` \| `state` |
| `order` | `desc` (default) \| `asc` |
| `filter` | `all` \| `running` \| `sleeping` \| `zombie` \| `stopped` \| `highcpu` \| `highmem` \| `hasio` \| `kernel` \| `user` |
| `q` | Substring over pid / name / cmdline / user / cgroup |
| `limit` / `offset` | Cap ≤2000 |
| `pid` | Optional — return one process with detail fields (fds, exe, cwd, …) |
Linux `/proc` only. Rates need two samples (~450ms cache). REST: `GET /api/v*/processes`. UI: [user-guide/processes.md](../user-guide/processes.md).
### Live subscriptions
| Method | Role | Args |
+1
View File
@@ -105,6 +105,7 @@ Single-agent returns one node. With `PEARDATA_PARENT=1`, `/nodes` and `/fleet` i
| GET | `/api/v3/q?q=` | Full-text over chart ids/titles |
| GET | `/api/v1\|v2\|v3/weights` | Metric Correlations + alert weights — see [Weights](#weights--metric-correlations); user guide: [weights-api](../user-guide/weights-api.md) |
| GET | `/api/v1\|v2\|v3/logs` | Log search — `source=anomaly\|audit\|journal`, `q`, `since`, `until`, `priority`, `unit`, `limit` — [user-guide/logs](../user-guide/logs.md) |
| GET | `/api/v1\|v2\|v3/processes` | Live process table — `sort`, `order`, `filter`, `q`, `limit`, `offset`, `pid` — [user-guide/processes](../user-guide/processes.md) |
### Alerts