private void handleResponse(MetricsResponse response,
                                Throwable exception,
                                MutableInteger failures,
                                ApplicationId application) {
        if (exception != null) {
            if (nodeRepository().zone().environment() == Environment.prod
                    && failures.get() < maxWarningsPerInvocation)
                log.log(Level.WARNING, "Could not update metrics for " + application + ": " +
                        Exceptions.toMessageString(exception));
            failures.add(1);
        }
        else if (response != null) {
            nodeRepository().metricsDb().addNodeMetrics(response.nodeMetrics());
            nodeRepository().metricsDb().addClusterMetrics(application, response.clusterMetrics());
        }
    }
Maintainer which keeps the node metric db up to date by periodically fetching metrics from all active nodes.

@author bratseth
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/NodeMetricsDbMaintainer.java