diff options
3 files changed, 8 insertions, 1 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java index 6b9a7d4021a..25ed3ec4b59 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java @@ -626,6 +626,7 @@ public class NodeAgentImpl implements NodeAgent { long memoryTotalBytesUsed = memoryTotalBytesUsage - memoryTotalBytesCache; double memoryUsageRatio = (double) memoryTotalBytesUsed / memoryTotalBytes; + double memoryTotalUsageRatio = (double) memoryTotalBytesUsage / memoryTotalBytes; Optional<Double> diskUsageRatio = diskTotalBytesUsed.map(used -> (double) used / diskTotalBytes); List<DimensionMetrics> metrics = new ArrayList<>(); @@ -633,6 +634,8 @@ public class NodeAgentImpl implements NodeAgent { .withMetric("mem.limit", memoryTotalBytes) .withMetric("mem.used", memoryTotalBytesUsed) .withMetric("mem.util", 100 * memoryUsageRatio) + .withMetric("mem_total.used", memoryTotalBytesUsage) + .withMetric("mem_total.util", 100 * memoryTotalUsageRatio) .withMetric("cpu.util", 100 * cpuUsageRatioOfAllocated) .withMetric("cpu.sys.util", 100 * cpuKernelUsageRatioOfAllocated) .withMetric("disk.limit", diskTotalBytes); diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImplTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImplTest.java index 83ee9b57918..b6128fc8693 100644 --- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImplTest.java +++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImplTest.java @@ -655,7 +655,9 @@ public class NodeAgentImplTest { long calledTimeout = (long) invocation.getArguments()[1]; String[] calledCommand = new String[invocation.getArguments().length - 2]; System.arraycopy(invocation.getArguments(), 2, calledCommand, 0, calledCommand.length); - calledCommand[calledCommand.length - 1] = calledCommand[calledCommand.length - 1].replaceAll("\"timestamp\":\\d+", "\"timestamp\":0"); + calledCommand[calledCommand.length - 1] = calledCommand[calledCommand.length - 1] + .replaceAll("\"timestamp\":\\d+", "\"timestamp\":0") + .replaceAll("([0-9]+\\.[0-9]{1,3})([0-9]*)", "$1"); // Only keep the first 3 decimals assertEquals(context, calledContainerName); assertEquals(5L, calledTimeout); diff --git a/node-admin/src/test/resources/expected.container.system.metrics.txt b/node-admin/src/test/resources/expected.container.system.metrics.txt index fab0f822d19..25de20803c7 100644 --- a/node-admin/src/test/resources/expected.container.system.metrics.txt +++ b/node-admin/src/test/resources/expected.container.system.metrics.txt @@ -10,6 +10,8 @@ s: "metrics": { "mem.limit": 4294967296, "mem.used": 1073741824, + "mem_total.util": 40.808, + "mem_total.used": 1752707072, "disk.used": 39625000000, "cpu.sys.util": 3.402, "disk.util": 15.85, |