Package org.jclouds.cloudwatch.domain

Examples of org.jclouds.cloudwatch.domain.Datapoint


   public DatapointHandler(DateService dateService) {
      this.dateService = dateService;
   }

   public Datapoint getResult() {
      Datapoint datapoint = new Datapoint(average, maximum, minimum, timestamp, samples, sum, unit, customUnit);
      this.average = null;
      this.maximum = null;
      this.minimum = null;
      this.timestamp = null;
      this.samples = null;
View Full Code Here


                                                      .build();
         GetMetricStatisticsResponse gmr = api().getMetricStatistics(gms);

         Assert.assertEquals(1, Iterables.size(gmr));

         Datapoint datapoint = gmr.iterator().next();

         Assert.assertEquals(datapoint.getTimestamp(), metricTimestampInCloudWatch);
         Assert.assertNull(datapoint.getCustomUnit());
         Assert.assertEquals(Unit.COUNT, datapoint.getUnit());
         Assert.assertNull(datapoint.getAverage());

         if (m.getDimensions().size() == 1) {
            Assert.assertEquals(10.0, datapoint.getMaximum());
            Assert.assertEquals(10.0, datapoint.getMinimum());
            Assert.assertEquals(10.0, datapoint.getSum());
            Assert.assertEquals(1.0, datapoint.getSamples());
         } else {
            Assert.assertEquals(4.0, datapoint.getMaximum());
            Assert.assertEquals(1.0, datapoint.getMinimum());
            Assert.assertEquals(10.0, datapoint.getSum());
            Assert.assertEquals(4.0, datapoint.getSamples());
         }
      }
   }
View Full Code Here

   DateService dateService = new SimpleDateFormatDateService();

   public Set<Datapoint> expected() {

      Set<Datapoint> expected = ImmutableSet.of(new Datapoint(0.17777777777777778, null, null, dateService
               .iso8601SecondsDateParse("2009-01-16T00:00:00Z"), 9.0, null, Unit.PERCENT, null), new Datapoint(0.1,
               null, null, dateService.iso8601SecondsDateParse("2009-01-16T00:01:00Z"), 8.0, null, Unit.PERCENT, null));
      return expected;
   }
View Full Code Here

TOP

Related Classes of org.jclouds.cloudwatch.domain.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.