Search in sources :

Example 1 with DockerExecTimeoutException

use of com.yahoo.vespa.hosted.dockerapi.DockerExecTimeoutException in project vespa by vespa-engine.

the class NodeAgentImpl method pushMetricsToContainer.

private void pushMetricsToContainer(List<DimensionMetrics> metrics) {
    StringBuilder params = new StringBuilder();
    try {
        for (DimensionMetrics dimensionMetrics : metrics) {
            params.append(dimensionMetrics.toSecretAgentReport());
        }
        String wrappedMetrics = "s:" + params.toString();
        // Push metrics to the metrics proxy in each container - give it maximum 1 seconds to complete
        String[] command = { "vespa-rpc-invoke", "-t", "2", "tcp/localhost:19091", "setExtraMetrics", wrappedMetrics };
        dockerOperations.executeCommandInContainerAsRoot(containerName, 5L, command);
    } catch (DockerExecTimeoutException | JsonProcessingException e) {
        logger.warning("Unable to push metrics to container: " + containerName, e);
    }
}
Also used : DimensionMetrics(com.yahoo.vespa.hosted.dockerapi.metrics.DimensionMetrics) DockerExecTimeoutException(com.yahoo.vespa.hosted.dockerapi.DockerExecTimeoutException) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException)

Aggregations

JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 DockerExecTimeoutException (com.yahoo.vespa.hosted.dockerapi.DockerExecTimeoutException)1 DimensionMetrics (com.yahoo.vespa.hosted.dockerapi.metrics.DimensionMetrics)1