Merge pull request #259 from andreisavu/datapoint-public

Make Datapoint getters public
This commit is contained in:
Adrian Cole 2011-12-19 01:42:01 -08:00
commit 75604da8f2
2 changed files with 15 additions and 9 deletions

View File

@ -56,7 +56,7 @@ public class Datapoint {
* return Average of samples for the datapoint. * return Average of samples for the datapoint.
*/ */
@Nullable @Nullable
Double getAverage() { public Double getAverage() {
return average; return average;
} }
@ -64,7 +64,7 @@ public class Datapoint {
* return Maximum of the samples used for the datapoint. * return Maximum of the samples used for the datapoint.
*/ */
@Nullable @Nullable
Double getMaximum() { public Double getMaximum() {
return maximum; return maximum;
} }
@ -72,7 +72,7 @@ public class Datapoint {
* return Minimum of samples for the datapoint. * return Minimum of samples for the datapoint.
*/ */
@Nullable @Nullable
Double getMinimum() { public Double getMinimum() {
return minimum; return minimum;
} }
@ -80,7 +80,7 @@ public class Datapoint {
* return Indicates the beginning of the time aggregation for this value and samples. * return Indicates the beginning of the time aggregation for this value and samples.
*/ */
@Nullable @Nullable
Date getTimestamp() { public Date getTimestamp() {
return timestamp; return timestamp;
} }
@ -88,7 +88,7 @@ public class Datapoint {
* return The number of Measurements that contributed to the aggregate value of this datapoint. * return The number of Measurements that contributed to the aggregate value of this datapoint.
*/ */
@Nullable @Nullable
Double getSamples() { public Double getSamples() {
return samples; return samples;
} }
@ -96,7 +96,7 @@ public class Datapoint {
* return Sum of samples for the datapoint. * return Sum of samples for the datapoint.
*/ */
@Nullable @Nullable
Double getSum() { public Double getSum() {
return sum; return sum;
} }
@ -104,7 +104,7 @@ public class Datapoint {
* return Standard unit used for the datapoint. * return Standard unit used for the datapoint.
*/ */
@Nullable @Nullable
StandardUnit getUnit() { public StandardUnit getUnit() {
return unit; return unit;
} }
@ -112,7 +112,7 @@ public class Datapoint {
* return CustomUnit defined for the datapoint. * return CustomUnit defined for the datapoint.
*/ */
@Nullable @Nullable
String getCustomUnit() { public String getCustomUnit() {
return customUnit; return customUnit;
} }

View File

@ -23,8 +23,11 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.Properties; import java.util.Properties;
import java.util.Set;
import org.jclouds.Constants; import org.jclouds.Constants;
import org.jclouds.cloudwatch.domain.Datapoint;
import org.jclouds.logging.Logger;
import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import org.jclouds.rest.RestContext; import org.jclouds.rest.RestContext;
import org.jclouds.rest.RestContextFactory; import org.jclouds.rest.RestContextFactory;
@ -89,7 +92,10 @@ public class CloudWatchClientLiveTest {
protected void getMetricStatisticsInRegion(String region) { protected void getMetricStatisticsInRegion(String region) {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.add(Calendar.MINUTE, -1); cal.add(Calendar.MINUTE, -1);
assert client.getMetricStatisticsInRegion(region, "CPUUtilization", cal.getTime(), new Date(), 60, "Average") != null;
Set<Datapoint> datapoints = client.getMetricStatisticsInRegion(
region, "CPUUtilization", cal.getTime(), new Date(), 60, "Average");
assert datapoints != null;
} }
@AfterTest @AfterTest