summaryrefslogtreecommitdiffstats
path: root/node-admin
diff options
context:
space:
mode:
authorYngve Aasheim <yngveaasheim@users.noreply.github.com>2017-03-20 16:18:08 +0100
committerGitHub <noreply@github.com>2017-03-20 16:18:08 +0100
commitfd7f8066124650dc8ec8618325161db9bb77ac1b (patch)
treed1aa5525fa5ddacbd4a418f3485f61272c9aa1a9 /node-admin
parent67d43ce529d8825008afd15edc4fe0308f5c6f82 (diff)
parentf8d8c792591d817ecb3a46c961625eb16bb6a4ce (diff)
Merge pull request #2038 from yahoo/freva/add-docker-metrics-debug
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");