/** * {@inheritDoc} */ @Override public Metric getResult() { Metric metric = new Metric(metricName, namespace, dimensions); // Reset since this handler is created once but produces N results dimensions = Sets.newLinkedHashSet(); metricName = null; namespace = null; return metric; }
private void performDefaultMetricsTests(IterableWithMarker<Metric> response) { // If there are less than 500 metrics, NextToken should be null if (Iterables.size(response) < 500) { checkArgument(!response.nextMarker().isPresent(), "NextToken should be null for response with fewer than 500 metrics."); } for (Metric metric : response) { Set<Dimension> dimensions = metric.getDimensions(); checkArgument(dimensions.size() <= 10, "Dimensions set cannot be greater than 10 items."); for (Dimension dimension : dimensions) { checkNotNull(dimension.getName(), "Name cannot be null for a Dimension."); checkNotNull(dimension.getValue(), "Value cannot be null for a Dimension."); } checkNotNull(metric.getMetricName(), "MetricName cannot be null for a Metric."); checkNotNull(metric.getNamespace(), "Namespace cannot be null for a Metric."); } }
.dimensions(m.getDimensions()) .namespace(namespace) .metricName(m.getMetricName()) .endTime(endTime) .statistic(Statistics.MAXIMUM) Assert.assertNull(datapoint.getAverage()); if (m.getDimensions().size() == 1) { Assert.assertEquals(10.0, datapoint.getMaximum()); Assert.assertEquals(10.0, datapoint.getMinimum());
private void performDefaultMetricsTests(IterableWithMarker<Metric> response) { // If there are less than 500 metrics, NextToken should be null if (Iterables.size(response) < 500) { checkArgument(!response.nextMarker().isPresent(), "NextToken should be null for response with fewer than 500 metrics."); } for (Metric metric : response) { Set<Dimension> dimensions = metric.getDimensions(); checkArgument(dimensions.size() <= 10, "Dimensions set cannot be greater than 10 items."); for (Dimension dimension : dimensions) { checkNotNull(dimension.getName(), "Name cannot be null for a Dimension."); checkNotNull(dimension.getValue(), "Value cannot be null for a Dimension."); } checkNotNull(metric.getMetricName(), "MetricName cannot be null for a Metric."); checkNotNull(metric.getNamespace(), "Namespace cannot be null for a Metric."); } }
.dimensions(m.getDimensions()) .namespace(namespace) .metricName(m.getMetricName()) .endTime(endTime) .statistic(Statistics.MAXIMUM) Assert.assertNull(datapoint.getAverage()); if (m.getDimensions().size() == 1) { Assert.assertEquals(10.0, datapoint.getMaximum()); Assert.assertEquals(10.0, datapoint.getMinimum());
Metric metric = response.iterator().next(); testMetricName = metric.getMetricName(); testNamespace = metric.getNamespace(); if (metric.getDimensions().size() > 0) { Dimension dimension = metric.getDimensions().iterator().next(); Set<Dimension> dimensions = metric1.getDimensions(); Dimension dimension = metric.getDimensions().iterator().next(); checkArgument(metric.getNamespace().equals(testNamespace), "All metrics should have the " + testNamespace + " Namespace."); checkArgument(metric.getMetricName().equals(testMetricName), "All metrics should have the " + testMetricName + " MetricName."); Set<Dimension> dimensions = metric.getDimensions(); boolean dimensionFound = false;
/** * {@inheritDoc} */ @Override public Metric getResult() { Metric metric = new Metric(metricName, namespace, dimensions); // Reset since this handler is created once but produces N results dimensions = Sets.newLinkedHashSet(); metricName = null; namespace = null; return metric; }
Metric metric = response.iterator().next(); testMetricName = metric.getMetricName(); testNamespace = metric.getNamespace(); if (!metric.getDimensions().isEmpty()) { Dimension dimension = metric.getDimensions().iterator().next(); Set<Dimension> dimensions = metric1.getDimensions(); Dimension dimension = metric.getDimensions().iterator().next(); checkArgument(metric.getNamespace().equals(testNamespace), "All metrics should have the " + testNamespace + " Namespace."); checkArgument(metric.getMetricName().equals(testMetricName), "All metrics should have the " + testMetricName + " MetricName."); Set<Dimension> dimensions = metric.getDimensions(); boolean dimensionFound = false;
/** * {@inheritDoc} */ @Override public Metric getResult() { Metric metric = new Metric(metricName, namespace, dimensions); // Reset since this handler is created once but produces N results dimensions = Sets.newLinkedHashSet(); metricName = null; namespace = null; return metric; }
Set<Dimension> dimensions = metric.getDimensions(); boolean testRan = false; .dimension(dimension) .endTime(endTime) .metricName(metric.getMetricName()) .namespace(metric.getNamespace()) .period(300) .startTime(cal.getTime())
/** * {@inheritDoc} */ @Override public Metric getResult() { Metric metric = new Metric(metricName, namespace, dimensions); // Reset since this handler is created once but produces N results dimensions = Sets.newLinkedHashSet(); metricName = null; namespace = null; return metric; }
Set<Dimension> dimensions = metric.getDimensions(); boolean testRan = false; .dimension(dimension) .endTime(endTime) .metricName(metric.getMetricName()) .namespace(metric.getNamespace()) .period(300) .startTime(cal.getTime())
/** * {@inheritDoc} */ @Override public Metric getResult() { Metric metric = new Metric(metricName, namespace, dimensions); // Reset since this handler is created once but produces N results dimensions = Sets.newLinkedHashSet(); metricName = null; namespace = null; return metric; }
/** * {@inheritDoc} */ @Override public Metric getResult() { Metric metric = new Metric(metricName, namespace, dimensions); // Reset since this handler is created once but produces N results dimensions = Sets.newLinkedHashSet(); metricName = null; namespace = null; return metric; }