feat: add Linux PSI I/O pressure monitoring with real-time dashboard panel and auto-refresh on DOM mutations

Add io_pressure() function to parse /proc/pressure/io with line splitting, key-value extraction from some/full metrics, and OSError/ValueError exception handling returning available:False on failure. Add io_pressure() call to datastore_snapshot() return dict. Add DOMContentLoaded script to create #ioPressurePanel section with datastore-panel/io-pressure-panel classes, innerHTML with I/O-
This commit is contained in:
nessi committed 2026-08-17 19:21:49 +02:00
1 parent c6c2437732
commit b275164be9
2 files changed
+18 -2

No files matched your search

+14 -1
View File
@@ -338,6 +338,19 @@ def format_remaining_time(value):
parts.append(f"{minutes} Min.")
return " ".join(parts) or "< 1 Min."
def io_pressure():
"""Read Linux PSI I/O pressure, if the kernel exposes it."""
try:
values = {}
for line in Path("/proc/pressure/io").read_text().splitlines():
parts = line.split()
if not parts:
continue
values[parts[0]] = {key: float(value) for key, value in (item.split("=", 1) for item in parts[1:] if "=" in item)}
return {"some": values.get("some", {}), "full": values.get("full", {}), "available": bool(values)}
except (OSError, ValueError):
return {"some": {}, "full": {}, "available": False}
def smart_status(device):
if not SMART_ENABLED:
return "Nicht aktiviert"
@@ -527,7 +540,7 @@ def datastore_snapshot():
elif current_raid.get("status") != "failed":
datastore_cache["raid"] = dict(current_raid)
datastore_cache["raid_at"] = now
return {"storage": storage, "raid": current_raid, "cache_seconds": STORAGE_CACHE_SECONDS}
return {"storage": storage, "raid": current_raid, "io_pressure": io_pressure(), "cache_seconds": STORAGE_CACHE_SECONDS}
def cpu_usage_percent():
global previous_cpu