Search in sources :

Example 1 with AggregationType

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);
}
Also used : Period(com.axibase.tsd.api.model.Period) Aggregate(com.axibase.tsd.api.model.series.query.transformation.aggregate.Aggregate) AggregationType(com.axibase.tsd.api.model.series.query.transformation.aggregate.AggregationType) AggregationInterpolate(com.axibase.tsd.api.model.series.query.transformation.AggregationInterpolate)

Example 2 with AggregationType

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]);
}
Also used : AggregationType(com.axibase.tsd.api.model.series.query.transformation.aggregate.AggregationType) DataProvider(org.testng.annotations.DataProvider)

Example 3 with AggregationType

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);
}
Also used : GroupType(com.axibase.tsd.api.model.series.query.transformation.group.GroupType) Aggregate(com.axibase.tsd.api.model.series.query.transformation.aggregate.Aggregate) SeriesGroupInfo(com.axibase.tsd.api.model.series.SeriesGroupInfo) AggregationType(com.axibase.tsd.api.model.series.query.transformation.aggregate.AggregationType)

Example 4 with AggregationType

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;
}
Also used : ArrayList(java.util.ArrayList) Period(com.axibase.tsd.api.model.Period) ArrayList(java.util.ArrayList) List(java.util.List) Aggregate(com.axibase.tsd.api.model.series.query.transformation.aggregate.Aggregate) AggregationInterpolate(com.axibase.tsd.api.model.series.query.transformation.AggregationInterpolate) AggregationType(com.axibase.tsd.api.model.series.query.transformation.aggregate.AggregationType)

Example 5 with AggregationType

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;
}
Also used : Period(com.axibase.tsd.api.model.Period) Aggregate(com.axibase.tsd.api.model.series.query.transformation.aggregate.Aggregate) AggregationType(com.axibase.tsd.api.model.series.query.transformation.aggregate.AggregationType) AggregationInterpolate(com.axibase.tsd.api.model.series.query.transformation.AggregationInterpolate)

Aggregations

AggregationType (com.axibase.tsd.api.model.series.query.transformation.aggregate.AggregationType)5 Aggregate (com.axibase.tsd.api.model.series.query.transformation.aggregate.Aggregate)4 Period (com.axibase.tsd.api.model.Period)3 AggregationInterpolate (com.axibase.tsd.api.model.series.query.transformation.AggregationInterpolate)3 SeriesGroupInfo (com.axibase.tsd.api.model.series.SeriesGroupInfo)1 GroupType (com.axibase.tsd.api.model.series.query.transformation.group.GroupType)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 DataProvider (org.testng.annotations.DataProvider)1