Commit Graph

2 Commits

Author SHA1 Message Date
nicolargo
a367dce523 feat(v5): fs thresholds 70/80/90 + non-prominent + alert "ongoing" marker
Three small UX adjustments raised on the live TUI:

1. ``fs.percent`` schema: explicit ``prominent: False``. Colours the
   Used cell at alert level but no longer reverse-videos it (the
   framework defaults missing ``prominent`` to True). Consistent with
   sin/sout in memswap.

2. ``fs.percent`` default thresholds raised to 70/80/90. Filesystems
   often sit at 60-70% on healthy hosts and the old 50/70/90 ladder
   produced noisy "careful" warnings. ``mem`` keeps the stricter
   50/70/90.

3. Alert block UI clarifies active-vs-resolved state:
   - Header was ``ALERTS (N)`` — now ``ALERT (X ongoing / Y total)``.
     ``ongoing`` = unique (plugin, key, field) tuples whose
     most-recent event has a non-ok level. ``total`` = full history
     length.
   - Each event row ending in a non-ok level for the **latest** event
     of its tuple gets a visible ``(ongoing)`` suffix on the level
     cell:
       ``careful (ongoing)``
       ``careful → warning (ongoing)``
     Older non-ok events superseded by a later resolution lose the
     marker — they are no longer ongoing. Resolutions
     (``warning → ok``) never carry the marker.

7 new tests:
- ``test_percent_is_watched_but_not_prominent`` (fs schema)
- ``test_percent_default_thresholds_are_70_80_90`` (fs schema)
- 1 fs runtime test updated to the new ladder + non-prominent
- 4 renderer tests covering header counts, ongoing marker, resolution
  exemption, latest-per-tuple semantics.

Full v5 suite: 734 passed, lint clean.
2026-05-15 17:39:22 +02:00
nicolargo
39c5858dd6 feat(v5): G4-fs — port the fs plugin to v5 (collection)
Collection plugin keyed on ``mnt_point``. Mirrors v4
``glances/plugins/fs/__init__.py``.

Model (``glances/plugins/fs/model_v5.py``):
- Fields: mnt_point (PK), device_name, fs_type (internal), options
  (internal), size, used, free, percent.
- ``percent`` watched/prominent with the standard 50/70/90 ladder.
- ``_grab_stats`` swallows PermissionError from
  ``psutil.disk_partitions`` (locked-down hosts) and per-partition
  OSError from ``disk_usage`` (ejected media, broken NFS mount) —
  the offending partition is dropped from the cycle without aborting
  the whole update.
- SNMP support left out (architecture §10).

Renderer (``glances/plugins/fs/render_curses_v5.py``):

    FILE SYS              Used   Total
    /                   125.0G  500.0G
    /home               512.0G    1.0T

- 3-cell rows (mnt + Used + Total), 18 + 1 + 7 + 1 + 7 = 34 chars —
  fits the left-sidebar cap exactly.
- Filesystems sorted by mountpoint (v4 parity).
- ``Used`` cell inherits the percent-threshold color from
  ``_levels.<mnt>.percent``; title escalates on warning/critical.
- Long mountpoints tail-truncated with a leading underscore.
- ``--fs-free-space`` toggle and the optional ``(device)`` suffix
  deferred to a later phase pending CLI / max_width plumbing.

Adjacent (already committed by the maintainer in 1da70476):
- ``KNOWN_V5_MISSING_PLUGINS`` shrinks to ``(processlist, diskio)``.
- v4 catalogue grows a ``## fs`` section +  footer.
- ``test_attach_mcp_logs_known_v5_gaps`` updated.

24 new tests (11 model + 13 renderer). Full v5 suite: 728 passed.
2026-05-15 17:18:42 +02:00