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) {