use of com.axibase.tsd.api.model.Period in project atsd-api-test by axibase.
the class SeriesQueryAggregateGroupOrderRateTest method testDefaultOrderGroupAggregate.
@Issue("4729")
@Test(description = "test query result with default Group/Aggregate order")
public void testDefaultOrderGroupAggregate() {
SeriesQuery query = new SeriesQuery("*", TEST_METRIC, "2017-01-01T00:00:00Z", "2017-01-01T00:00:20Z");
query.setAggregate(new Aggregate(AggregationType.COUNT, new Period(10, TimeUnit.SECOND)));
query.setGroup(new Group(GroupType.MAX, new Period(5, TimeUnit.SECOND)));
Set<CheckedFields> actualFields = createCheckFields(querySeriesAsList(query));
CheckedFields series = new CheckedFields("*", Arrays.asList(Sample.ofDateDecimal("2017-01-01T00:00:00.000Z", new BigDecimal("2.0")), Sample.ofDateDecimal("2017-01-01T00:00:10.000Z", new BigDecimal("2.0"))));
Set<CheckedFields> expectedFields = collectCheckFields(series);
assertEquals(actualFields, expectedFields, "Incorrect query result with default Group/Aggregate order");
}
use of com.axibase.tsd.api.model.Period in project atsd-api-test by axibase.
the class PropertyInsertTest method testISOTimezoneZ.
@Issue("2850")
@Test
public void testISOTimezoneZ() {
Property property = new Property("test1", "property-insert-test-isoz");
property.addTag("test", "test");
property.setDate("2016-07-21T00:00:00Z");
insertProperty(property);
PropertyQuery propertyQuery = new PropertyQuery();
propertyQuery.setEntity("property-insert-test-isoz");
propertyQuery.setStartDate("2016-07-21T00:00:00.000Z");
propertyQuery.setInterval(new Period(1, TimeUnit.MILLISECOND));
propertyQuery.setType(property.getType());
List<Property> storedPropertyList = queryProperty(propertyQuery).readEntity(ResponseAsList.ofProperties());
Property storedProperty = storedPropertyList.get(0);
assertEquals("Incorrect property entity", property.getEntity(), storedProperty.getEntity());
assertEquals("Incorrect property tags", property.getTags(), storedProperty.getTags());
assertEquals("Incorrect property date", propertyQuery.getStartDate(), storedProperty.getDate());
}
use of com.axibase.tsd.api.model.Period in project atsd-api-test by axibase.
the class TransformationPermutationsTest method setUpGrouping.
private void setUpGrouping() {
Period period = new Period(5, TimeUnit.MINUTE, PeriodAlignment.START_TIME);
List<GroupType> aggregationFunctions = Arrays.asList(GroupType.FIRST, GroupType.SUM);
AggregationInterpolate interp = new AggregationInterpolate(AggregationInterpolateType.LINEAR, true);
groupSettings = new Group().setPeriod(period).setTypes(aggregationFunctions).setInterpolate(interp);
query.setGroup(groupSettings);
}
use of com.axibase.tsd.api.model.Period in project atsd-api-test by axibase.
the class TransformationPermutationsTest method setUpInterpolate.
private void setUpInterpolate() {
Period period = new Period(10, TimeUnit.MINUTE, PeriodAlignment.START_TIME);
interpolationSettings = new Interpolate(InterpolateFunction.LINEAR, period);
query.setInterpolate(interpolationSettings);
}
use of com.axibase.tsd.api.model.Period in project atsd-api-test by axibase.
the class TransformationPermutationsTest method setUpAggregation.
private void setUpAggregation() {
Period period = new Period(3, TimeUnit.MINUTE, PeriodAlignment.START_TIME);
List<AggregationType> aggregationFunctions = Arrays.asList(AggregationType.AVG, AggregationType.SUM, AggregationType.FIRST);
AggregationInterpolate interp = new AggregationInterpolate(AggregationInterpolateType.LINEAR, true);
aggregationSettings = new Aggregate().setPeriod(period).setTypes(aggregationFunctions).setInterpolate(interp);
query.setAggregate(aggregationSettings);
}
Aggregations