use of com.axibase.tsd.api.model.Period in project atsd-api-test by axibase.
the class SeriesQueryAggregateGroupOrderRateTest method testDefaultOrderGroupRate.
@Issue("4729")
@Test(description = "test query result with default Group/Rate order")
public void testDefaultOrderGroupRate() {
SeriesQuery query = new SeriesQuery("*", TEST_METRIC, "2017-01-01T00:00:00Z", "2017-01-01T00:00:20Z");
query.setGroup(new Group(GroupType.MAX, new Period(5, TimeUnit.SECOND)));
query.setRate(new Rate(new Period(10, TimeUnit.SECOND)));
Set<CheckedFields> actualFields = createCheckFields(querySeriesAsList(query));
CheckedFields series = new CheckedFields("*", Arrays.asList(Sample.ofDateDecimal("2017-01-01T00:00:05.000Z", new BigDecimal("8.0")), Sample.ofDateDecimal("2017-01-01T00:00:10.000Z", new BigDecimal("12.0")), Sample.ofDateDecimal("2017-01-01T00:00:15.000Z", new BigDecimal("8.0"))));
Set<CheckedFields> expectedFields = collectCheckFields(series);
assertEquals(actualFields, expectedFields, "Incorrect query result with default Group/Rate order");
}
use of com.axibase.tsd.api.model.Period in project atsd-api-test by axibase.
the class SeriesQueryAggregateGroupOrderRateTest method testAggregateSeriesLimit.
@Issue("4729")
@Test(description = "test query result with aggregate seriesLimit")
public void testAggregateSeriesLimit() {
SeriesQuery query = new SeriesQuery("*", TEST_METRIC, "2017-01-01T00:00:00Z", "2017-01-01T00:00:20Z");
query.setAggregate(new Aggregate(AggregationType.MIN, new Period(10, TimeUnit.SECOND)));
query.setSeriesLimit(1);
Set<CheckedFields> actualFields = createCheckFields(querySeriesAsList(query));
CheckedFields series = new CheckedFields(TEST_ENTITY1, Arrays.asList(Sample.ofDateDecimal("2017-01-01T00:00:00.000Z", new BigDecimal("101.0")), Sample.ofDateDecimal("2017-01-01T00:00:10.000Z", new BigDecimal("111.0"))));
Set<CheckedFields> expectedFields = collectCheckFields(series);
assertEquals(actualFields, expectedFields, "Incorrect query result with aggregate seriesLimit");
}
use of com.axibase.tsd.api.model.Period in project atsd-api-test by axibase.
the class TransformationPermutationsTest method setUpRate.
private void setUpRate() {
Period period = new Period(1, TimeUnit.MINUTE);
rateSettings = new Rate(period);
rateSettings.setCounter(false);
query.setRate(rateSettings);
}
Aggregations