Examples of PutMetricDataRequest


Examples of com.amazonaws.services.cloudwatch.model.PutMetricDataRequest

            // Each CloudWatch API request may contain at maximum 20 datums.
            List<List<MetricDatum>> dataPartitions = Lists.partition(data, 20);
            List<Future<?>> cloudWatchFutures = new ArrayList<Future<?>>(dataPartitions.size());

            for (List<MetricDatum> dataSubset : dataPartitions) {
                cloudWatchFutures.add(cloudWatch.putMetricDataAsync(new PutMetricDataRequest()
                        .withNamespace(metricNamespace)
                        .withMetricData(dataSubset)));
            }
            for (Future<?> cloudWatchFuture : cloudWatchFutures) {
                // We can't let an exception leak out of here, or else the reporter will cease running per mechanics of
View Full Code Here

Examples of com.amazonaws.services.cloudwatch.model.PutMetricDataRequest

            // Each CloudWatch API request may contain at maximum 20 datums.
            List<List<MetricDatum>> dataPartitions = Lists.partition(data, 20);
            List<Future<?>> cloudWatchFutures = new ArrayList<Future<?>>(dataPartitions.size());

            for (List<MetricDatum> dataSubset : dataPartitions) {
                cloudWatchFutures.add(cloudWatch.putMetricDataAsync(new PutMetricDataRequest()
                        .withNamespace(metricNamespace)
                        .withMetricData(dataSubset)));
            }
            for (Future<?> cloudWatchFuture : cloudWatchFutures) {
                // We can't let an exception leak out of here, or else the reporter will cease running per mechanics of
View Full Code Here

Examples of com.amazonaws.services.cloudwatch.model.PutMetricDataRequest

    }

    private List<PutMetricDataRequest> newPutMetricDataRequests(Collection<MetricDatum> data) {
        List<PutMetricDataRequest> list = new ArrayList<PutMetricDataRequest>();
        final String ns = AwsSdkMetrics.getMetricNameSpace();
        PutMetricDataRequest req = newPutMetricDataRequest(data, ns);
        list.add(req);
        String perHostNameSpace = null;
        final boolean perHost = AwsSdkMetrics.isPerHostMetricEnabled();
        if (perHost) {
            String hostName = AwsSdkMetrics.getHostMetricName();
View Full Code Here

Examples of com.amazonaws.services.cloudwatch.model.PutMetricDataRequest

        return output;
    }

    private PutMetricDataRequest newPutMetricDataRequest(
            Collection<MetricDatum> data, String namespace) {
        return new PutMetricDataRequest()
            .withNamespace(namespace)
            .withMetricData(data)
            .withRequestMetricCollector(RequestMetricCollector.NONE)
            ;
    }
View Full Code Here

Examples of com.amazonaws.services.cloudwatch.model.PutMetricDataRequest

    }

    public void process(Exchange exchange) throws Exception {
        List<MetricDatum> metricData = getMetricData(exchange);

        PutMetricDataRequest request = new PutMetricDataRequest()
                .withMetricData(metricData)
                .withNamespace(determineNameSpace(exchange));

        log.info("Sending request [{}] from exchange [{}]...", request, exchange);
        getEndpoint().getCloudWatchClient().putMetricData(request);
View Full Code Here

Examples of com.amazonaws.services.cloudwatch.model.PutMetricDataRequest

        }
        return list;
    }

    private PutMetricDataRequest newPutMetricDataRequest(Collection<MetricDatum> data) {
        PutMetricDataRequest req = new PutMetricDataRequest()
            .withNamespace(AwsSdkMetrics.METRICS_NAMESPACE)
            .withMetricData(data)
            .withRequestMetricCollector(RequestMetricCollector.NONE)
            ;
        return req;
View Full Code Here

Examples of com.amazonaws.services.cloudwatch.model.PutMetricDataRequest

    @Override
    public void publishMetrics(List<MetricDatumWithKey<CWMetricKey>> dataToPublish) {
        for (int startIndex = 0; startIndex < dataToPublish.size(); startIndex += BATCH_SIZE) {
            int endIndex = Math.min(dataToPublish.size(), startIndex + BATCH_SIZE);

            PutMetricDataRequest request = new PutMetricDataRequest();
            request.setNamespace(namespace);

            List<MetricDatum> metricData = new ArrayList<MetricDatum>();
            for (int i = startIndex; i < endIndex; i++) {
                metricData.add(dataToPublish.get(i).datum);
            }

            request.setMetricData(metricData);

            try {
                cloudWatchClient.putMetricData(request);

                LOG.info(String.format("Successfully published %d datums.", endIndex - startIndex));
View Full Code Here

Examples of com.amazonaws.services.cloudwatch.model.PutMetricDataRequest

    }

    public void process(Exchange exchange) throws Exception {
        List<MetricDatum> metricData = getMetricData(exchange);

        PutMetricDataRequest request = new PutMetricDataRequest()
                .withMetricData(metricData)
                .withNamespace(determineNameSpace(exchange));

        log.info("Sending request [{}] from exchange [{}]...", request, exchange);
        getEndpoint().getCloudWatchClient().putMetricData(request);
View Full Code Here

Examples of com.amazonaws.services.cloudwatch.model.PutMetricDataRequest

            // Each CloudWatch API request may contain at maximum 20 datums.
            List<List<MetricDatum>> dataPartitions = Lists.partition(data, 20);
            List<Future<?>> cloudWatchFutures = new ArrayList<Future<?>>(dataPartitions.size());

            for (List<MetricDatum> dataSubset : dataPartitions) {
                cloudWatchFutures.add(cloudWatch.putMetricDataAsync(new PutMetricDataRequest()
                        .withNamespace(metricNamespace)
                        .withMetricData(dataSubset)));
            }
            for (Future<?> cloudWatchFuture : cloudWatchFutures) {
                // We can't let an exception leak out of here, or else the reporter will cease running per mechanics of
View Full Code Here

Examples of com.amazonaws.services.cloudwatch.model.PutMetricDataRequest

        this.sendJVMGC = sendJVMGC;
    }

    @Override
    public void run() {
        putReq = new PutMetricDataRequest().withNamespace(namespace);
        try {
            Date timestamp = new Date();
            sendVMMetrics(timestamp);
            sendRegularMetrics(timestamp);
            sendToCloudWatch();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.