update memory metric
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m24s

This commit is contained in:
Lee 2024-04-17 01:02:06 +01:00
parent d8d4f32006
commit 8f758820e1

@ -18,7 +18,8 @@ public class MemoryMetric extends MapMetric<String, Long> {
public void collect() {
Runtime runtime = Runtime.getRuntime();
this.getValue().put("total", runtime.totalMemory());
this.getValue().put("total", runtime.maxMemory());
this.getValue().put("allocated", runtime.totalMemory());
this.getValue().put("used", runtime.totalMemory() - runtime.freeMemory());
}
}