fix: correct jemalloc metrics (#6959)

The allocated and resident metrics were swapped in the set calls. This commit
fixes the issue by ensuring each metric receives its corresponding value.
This commit is contained in:
fys
2025-09-11 14:37:19 +08:00
committed by GitHub
parent 5e65581f94
commit 733a1afcd1

View File

@@ -71,8 +71,8 @@ impl JemallocCollector {
let _ = self.epoch.advance().context(UpdateJemallocMetricsSnafu)?;
let allocated = self.allocated.read().context(UpdateJemallocMetricsSnafu)?;
let resident = self.resident.read().context(UpdateJemallocMetricsSnafu)?;
SYS_JEMALLOC_RESIDEN.set(allocated as i64);
SYS_JEMALLOC_ALLOCATED.set(resident as i64);
SYS_JEMALLOC_ALLOCATED.set(allocated as i64);
SYS_JEMALLOC_RESIDEN.set(resident as i64);
Ok(())
}
}