diff options
author | Valerij Fredriksen <valerij92@gmail.com> | 2019-06-16 13:44:27 +0200 |
---|---|---|
committer | Valerij Fredriksen <valerijf@verizonmedia.com> | 2019-06-16 16:02:10 +0200 |
commit | 2a8281e1ebfddf7107e84cc7d9889729ad41bded (patch) | |
tree | a2a7d0e4c994171cb406d9eb6b061647dd960093 /node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java | |
parent | 49b52ad921f270a8595d2d5e1b23095d0b971ce7 (diff) |
Combine NodeAdmin update metrics methods
Diffstat (limited to 'node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java')
-rw-r--r-- | node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java index de3e6a7c64f..2da934b635d 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java @@ -44,7 +44,7 @@ public class NodeAdminImpl implements NodeAdmin { private final GaugeWrapper jvmHeapUsed; private final GaugeWrapper jvmHeapFree; private final GaugeWrapper jvmHeapTotal; - private final CounterWrapper numberOfUnhandledExceptionsInNodeAgent; + private final CounterWrapper numberOfUnhandledExceptions; public NodeAdminImpl(NodeAgentFactory nodeAgentFactory, MetricReceiverWrapper metricReceiver, Clock clock) { this((NodeAgentWithSchedulerFactory) nodeAgentContext -> create(clock, nodeAgentFactory, nodeAgentContext), @@ -103,19 +103,12 @@ public class NodeAdminImpl implements NodeAdmin { } @Override - public void updateNodeAgentMetrics() { - int numberContainersWaitingImage = 0; - int numberOfNewUnhandledExceptions = 0; + public void updateMetrics() { for (NodeAgentWithScheduler nodeAgentWithScheduler : nodeAgentWithSchedulerByHostname.values()) { - numberOfNewUnhandledExceptions += nodeAgentWithScheduler.getAndResetNumberOfUnhandledExceptions(); + numberOfUnhandledExceptions.add(nodeAgentWithScheduler.getAndResetNumberOfUnhandledExceptions()); nodeAgentWithScheduler.updateContainerNodeMetrics(); } - numberOfUnhandledExceptionsInNodeAgent.add(numberOfNewUnhandledExceptions); - } - - @Override - public void updateNodeAdminMetrics() { Runtime runtime = Runtime.getRuntime(); long freeMemory = runtime.freeMemory(); long totalMemory = runtime.totalMemory(); |