Change: use glances rss instead of data for process memory reporting (#5392)

This commit is contained in:
shamoon 2025-06-07 15:49:07 -07:00 committed by GitHub
parent 5759596a37
commit 34bffe980a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,7 +23,7 @@ export default function Component({ service }) {
const { widget } = service;
const { chart, refreshInterval = defaultInterval, version = 3 } = widget;
const memoryInfoKey = version === 3 ? 0 : "data";
const memoryInfoKey = version === 3 ? 0 : "rss";
const { data, error } = useWidgetAPI(service.widget, `${version}/processlist`, {
refreshInterval: Math.max(defaultInterval, refreshInterval),
@ -69,7 +69,7 @@ export default function Component({ service }) {
<div className="opacity-25 w-14 text-right">{item.cpu_percent.toFixed(1)}%</div>
<div className="opacity-25 w-14 text-right">
{t("common.bytes", {
value: item.memory_info[memoryInfoKey] ?? item.memory_info.wset,
value: item.memory_info[memoryInfoKey] ?? item.memory_info.data ?? item.memory_info.wset,
maximumFractionDigits: 0,
})}
</div>