use of com.axibase.tsd.api.model.series.query.transformation.aggregate.AggregationType 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);
}
use of com.axibase.tsd.api.model.series.query.transformation.aggregate.AggregationType in project atsd-api-test by axibase.
the class SeriesQueryMultipleAggregationTest method provideDoubleAggregationFunctions.
@DataProvider
public Object[][] provideDoubleAggregationFunctions() {
List<Object[]> result = new ArrayList<>();
for (int firstFilter = 0; firstFilter < singleAggregationFunctions.length; firstFilter++) {
for (int secondFilter = 0; secondFilter < singleAggregationFunctions.length; secondFilter++) {
AggregationType firstFilterType = (AggregationType) singleAggregationFunctions[firstFilter][0];
String[] firstFilterExpectedResult = (String[]) singleAggregationFunctions[firstFilter][1];
AggregationType secondFilterType = (AggregationType) singleAggregationFunctions[secondFilter][0];
String[] secondFilterExpectedResult = (String[]) singleAggregationFunctions[secondFilter][1];
result.add(new Object[] { firstFilterType, firstFilterExpectedResult, secondFilterType, secondFilterExpectedResult });
}
}
return result.toArray(new Object[0][0]);
}
use of com.axibase.tsd.api.model.series.query.transformation.aggregate.AggregationType in project atsd-api-test by axibase.
the class SeriesSign method of.
public static SeriesSign of(Series series) {
String entity = series.getEntity();
Map<String, String> tags = series.getTags();
String side = tags == null ? null : tags.get("side");
Aggregate aggregate = series.getAggregate();
AggregationType aggregationType = aggregate == null ? null : aggregate.getType();
SeriesGroupInfo group = series.getGroup();
GroupType groupType = group == null ? null : group.getType();
return new SeriesSign(entity, side, aggregationType, groupType);
}
use of com.axibase.tsd.api.model.series.query.transformation.aggregate.AggregationType in project atsd-api-test by axibase.
the class SeriesQueryTransformationWithDifferentForecastTest method generateAggregationSet.
private List<Aggregate> generateAggregationSet() {
List<Aggregate> aggregates = new ArrayList<>();
List<List<AggregationType>> setsAggregationType = Arrays.asList(Arrays.asList(AggregationType.AVG, AggregationType.SUM, AggregationType.FIRST), Arrays.asList(AggregationType.AVG, AggregationType.SUM, AggregationType.FIRST, AggregationType.DETAIL));
Period period = new Period(AGGREGATION_PERIOD_COUNT, TimeUnit.MINUTE, PeriodAlignment.START_TIME);
AggregationInterpolate interp = new AggregationInterpolate(AggregationInterpolateType.LINEAR, true);
for (List<AggregationType> setAggregationType : setsAggregationType) {
aggregates.add(new Aggregate().setPeriod(period).setInterpolate(interp).setTypes(setAggregationType));
}
return aggregates;
}
use of com.axibase.tsd.api.model.series.query.transformation.aggregate.AggregationType in project atsd-api-test by axibase.
the class SeriesQueryHorizonTest method generateAggregationSettings.
private Aggregate generateAggregationSettings() {
Aggregate aggregate = new Aggregate();
List<AggregationType> aggregationType = new ArrayList<>();
aggregationType.add(AggregationType.AVG);
Period period = new Period(AGGREGATION_PERIOD, TimeUnit.MINUTE, PeriodAlignment.START_TIME);
AggregationInterpolate interp = new AggregationInterpolate(AggregationInterpolateType.LINEAR, true);
aggregate.setPeriod(period).setInterpolate(interp).setTypes(aggregationType);
return aggregate;
}
Aggregations