summaryrefslogtreecommitdiffstats
path: root/node-admin
diff options
context:
space:
mode:
authorvalerijf <valerijf@yahoo-inc.com>2017-03-20 16:03:14 +0100
committervalerijf <valerijf@yahoo-inc.com>2017-03-20 16:15:42 +0100
commitf8d8c792591d817ecb3a46c961625eb16bb6a4ce (patch)
tree16aac2d6f70f6668d61f840be7a6d17343b8b597 /node-admin
parent402b6f92de4b7e7e7f74e2351a84c71784f0f421 (diff)
Add debug logging for docker metrics reporting
Diffstat (limited to 'node-admin')
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java12
1 files changed, 10 insertions, 2 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 aa6f762543f..60987501d4b 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
@@ -508,14 +508,21 @@ public class NodeAgentImpl implements NodeAgent {
@SuppressWarnings("unchecked")
public void updateContainerNodeMetrics(int numAllocatedContainersOnHost) {
+ logger.debug("Gathering metrics");
ContainerNodeSpec nodeSpec;
synchronized (monitor) {
nodeSpec = lastNodeSpec;
}
- if (nodeSpec == null || !vespaVersion.isPresent()) return;
+ if (nodeSpec == null || !vespaVersion.isPresent()) {
+ logger.debug("Not updating container metrics, nodeSpec=" + nodeSpec + ", vespaVersion=" + vespaVersion);
+ return;
+ }
Optional<Docker.ContainerStats> containerStats = dockerOperations.getContainerStats(containerName);
- if ( ! containerStats.isPresent()) return;
+ if ( ! containerStats.isPresent()) {
+ logger.debug("Failed to get docker stats from daemon");
+ return;
+ }
Docker.ContainerStats stats = containerStats.get();
Dimensions.Builder dimensionsBuilder = new Dimensions.Builder()
@@ -551,6 +558,7 @@ public class NodeAgentImpl implements NodeAgent {
double cpuPercentageOfHost = lastCpuMetric.getCpuUsagePercentage(currentCpuContainerTotalTime, currentCpuSystemTotalTime);
double cpuPercentageOfAllocated = numAllocatedContainersOnHost * cpuPercentageOfHost;
metricReceiver.declareGauge(MetricReceiverWrapper.APPLICATION_DOCKER, dimensions, "node.cpu.busy.pct").sample(cpuPercentageOfAllocated);
+ logger.debug("Updated CPU busy metric with: " + cpuPercentageOfAllocated);
addIfNotNull(dimensions, "node.cpu.throttled_time", stats.getCpuStats().get("throttling_data"), "throttled_time");
addIfNotNull(dimensions, "node.memory.limit", stats.getMemoryStats(), "limit");