diff --git a/app.py b/app.py index 7ce4909..fb08f86 100644 --- a/app.py +++ b/app.py @@ -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 diff --git a/templates/index.html b/templates/index.html index f328f0d..be1284f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,6 +1,9 @@ +