Commit Graph
4 Commits
Author SHA1 Message Date
Nguyen Thanh Dat 9efec19af7 fix(diskio): alert on the bitrate, and decorate the field the WebUI reads
The rx/tx thresholds describe a bitrate, but update_views measured them
against read_bytes / write_bytes -- the lifetime counters psutil returns.
Those only grow, so on any machine with uptime a configured threshold latched
on within seconds and never came back down, whatever the disk was doing.
The network plugin next door already alerts on bytes_recv_rate_per_sec.

The decoration also went only to the counter keys. The TUI prints the rate and
reads read_bytes' decoration, so it showed a colour derived from the wrong
quantity; the WebUI asks for read_bytes_rate_per_sec, which nothing set, so it
showed no colour at all. Both keys now carry it, matching network again.

The rate view exists only once there is a timespan to divide by, so the rate
key is set when present -- setting it unconditionally raises KeyError on the
first sample, which the existing view tests catch.
2026-08-25 19:18:18 +07:00
SudeepMalipeddi c188365b42 fix: guard args access in msg_curse across 9 plugins
Several plugins call msg_curse(args=None) with args defaulting to None,
but then access args attributes directly (e.g. args.diskio_iops) without
checking if args is None first, causing AttributeError in tests and any
caller that omits args.

Add `args and` guard before every args attribute access in msg_curse for:
- diskio (4 places)
- fs (2 places)
- network (6 places)
- processlist (7 places)
- processcount (1 place)
- system (1 place)
- load (1 place)
- containers (1 place)
- gpu (2 places)

Also fix TestDiskioPluginMsgCurse tests to call update_views() before
msg_curse() so views are populated before rendering.

Fixes #3429
2026-02-24 23:17:24 +05:30
Ambika Patidar 5eb1f4b794 test: Fix linting issues and trailing whitespace 2026-02-07 00:55:14 +05:30
Ambika Patidar 645841d99a Added test cases for plugins 2026-02-06 17:51:37 +05:30