Commit Graph

1 Commits

Author SHA1 Message Date
nicolargo
779dee82ab feat(v5): G4-diskio — port diskio plugin to v5 (collection)
Last entry of ``KNOWN_V5_MISSING_PLUGINS`` after this commit:
``("processlist",)``.

Model (``glances/plugins/diskio/model_v5.py``):
- Fields: disk_name (PK, string), read_count / write_count
  (rate, number, internal — exportable for IOPS consumers but
  not rendered), read_bytes / write_bytes (rate, bytespers, watched,
  ``prominent=False``, ``strict_thresholds=True``, NO default
  thresholds).
- Sustained disk traffic is host-specific (a DB server may stream
  MB/s by design) — alerts only fire when operators set
  ``read_bytes_warning=...`` per-disk or per-field in
  ``[diskio]``. ``strict_thresholds=True`` blocks the bare-``<level>``
  fallback (same pattern as memswap.sin/sout) so a legacy
  ``[diskio] careful=50`` cannot trigger spurious alerts.
- ``read_time``/``write_time`` and the derived ``read_latency`` /
  ``write_latency`` of v4 are not ported — deferred with the
  ``--diskio-latency`` mode.
- ``psutil.disk_io_counters()`` may raise or return ``None`` on
  platforms without disk I/O support — model returns ``[]`` rather
  than crashing.

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

    DISK I/O              R/s     W/s
    nvme0n1               0B      0B
    sda                   1.4M   732K

- 3-cell rows, 18 + 1 + 7 + 1 + 7 = 34 chars (fits sidebar cap).
- Sorted by disk_name. Cycle-1 disks (no rate baseline) are skipped
  entirely — no ``-`` placeholder wall on startup.
- Rate cells display ``auto_unit(bytes_per_sec)`` WITHOUT a trailing
  ``/s`` — header carries the per-second semantic (v4 parity).
- Long disk names tail-truncated with leading underscore.

Adjacent:
- ``KNOWN_V5_MISSING_PLUGINS`` shrinks to ``("processlist",)``.
- ``test_attach_mcp_logs_known_v5_gaps`` updated.
- v4 catalogue grows a ``## diskio`` section +  footer.

28 new tests (13 model + 15 renderer). Full v5 suite: 762 passed.
2026-05-15 17:47:07 +02:00