Package com.amazonaws.services.cloudwatch.model

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


            GetMetricStatisticsResult getMetricStatisticsResult = cw.getMetricStatistics(request);

            double avgCPUUtilization = 0;
            List dataPoint = getMetricStatisticsResult.getDatapoints();
            for (Object aDataPoint : dataPoint) {
                Datapoint dp = (Datapoint) aDataPoint;
                avgCPUUtilization = dp.getAverage();
                log.info(instanceId + " instance's average CPU utilization : " + dp.getAverage());
            }

            return avgCPUUtilization;

        } catch (AmazonServiceException ase) {
View Full Code Here


    @Test
    public void retrievesAndCachesCloudWatchStats() {
        final long sum = 10;
        final CloudWatch cloudwatch = this.cloudWatch();
        final GetMetricStatisticsResult result = new GetMetricStatisticsResult()
            .withDatapoints(new Datapoint().withSum(Double.valueOf(sum)));
        Mockito.doReturn(result).when(cloudwatch.get())
            .getMetricStatistics(Mockito.any(GetMetricStatisticsRequest.class));
        MatcherAssert.assertThat(
            new DefaultHost(
                new BucketMocker().mock(),
View Full Code Here

TOP

Related Classes of com.amazonaws.services.cloudwatch.model.Datapoint

Copyright © 2018 www.massapicom. 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.