sysstat: network stats simplification without local history cache + adjusting existing polling intervals

This commit is contained in:
Lemmy
2026-02-02 08:57:09 -05:00
parent a8853b78f5
commit 93e34bcdb3
4 changed files with 39 additions and 76 deletions
+28
View File
@@ -0,0 +1,28 @@
import QtQuick
import Quickshell
QtObject {
id: root
function migrate(adapter, logger, rawJson) {
logger.i("Migration47", "Removing network_stats.json cache and updating polling intervals");
// Remove the network_stats.json cache file (no longer used - autoscaling from history now)
const shellName = "noctalia";
const cacheDir = Quickshell.env("NOCTALIA_CACHE_DIR") || (Quickshell.env("XDG_CACHE_HOME") || Quickshell.env("HOME") + "/.cache") + "/" + shellName + "/";
const networkStatsFile = cacheDir + "network_stats.json";
Quickshell.execDetached(["rm", "-f", networkStatsFile]);
// Update polling intervals to 1000ms for smoother graphs (only if currently slower)
if (adapter.systemMonitor.cpuPollingInterval > 1000)
adapter.systemMonitor.cpuPollingInterval = 1000;
if (adapter.systemMonitor.memPollingInterval > 1000)
adapter.systemMonitor.memPollingInterval = 1000;
if (adapter.systemMonitor.networkPollingInterval > 1000)
adapter.systemMonitor.networkPollingInterval = 1000;
logger.d("Migration47", "Removed network_stats.json and adjusted polling intervals");
return true;
}
}
+3 -1
View File
@@ -20,7 +20,8 @@ QtObject {
43: migration43Component,
44: migration44Component,
45: migration45Component,
46: migration46Component
46: migration46Component,
47: migration47Component
})
// Migration components
@@ -38,4 +39,5 @@ QtObject {
property Component migration44Component: Migration44 {}
property Component migration45Component: Migration45 {}
property Component migration46Component: Migration46 {}
property Component migration47Component: Migration47 {}
}