Search in sources :

Example 1 with GroupType

use of com.axibase.tsd.api.model.series.query.transformation.group.GroupType in project atsd-api-test by axibase.

the class SeriesQueryTransformationWithDifferentForecastTest method generateGroupingSet.

private List<Group> generateGroupingSet() {
    List<Group> groups = new ArrayList<>();
    List<List<GroupType>> setsGroupType = Arrays.asList(Arrays.asList(GroupType.AVG, GroupType.SUM), Arrays.asList(GroupType.AVG, GroupType.SUM, GroupType.DETAIL));
    Period period = new Period(GROUP_PERIOD_COUNT, TimeUnit.MINUTE, PeriodAlignment.START_TIME);
    AggregationInterpolate interp = new AggregationInterpolate(AggregationInterpolateType.LINEAR, true);
    for (List<GroupType> setGroupType : setsGroupType) {
        groups.add(new Group().setPeriod(period).setInterpolate(interp).setTypes(setGroupType));
    }
    return groups;
}
Also used : Group(com.axibase.tsd.api.model.series.query.transformation.group.Group) GroupType(com.axibase.tsd.api.model.series.query.transformation.group.GroupType) ArrayList(java.util.ArrayList) Period(com.axibase.tsd.api.model.Period) ArrayList(java.util.ArrayList) List(java.util.List) AggregationInterpolate(com.axibase.tsd.api.model.series.query.transformation.AggregationInterpolate)

Example 2 with GroupType

use of com.axibase.tsd.api.model.series.query.transformation.group.GroupType 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);
}
Also used : Group(com.axibase.tsd.api.model.series.query.transformation.group.Group) GroupType(com.axibase.tsd.api.model.series.query.transformation.group.GroupType) Period(com.axibase.tsd.api.model.Period) AggregationInterpolate(com.axibase.tsd.api.model.series.query.transformation.AggregationInterpolate)

Example 3 with GroupType

use of com.axibase.tsd.api.model.series.query.transformation.group.GroupType 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)

Aggregations

GroupType (com.axibase.tsd.api.model.series.query.transformation.group.GroupType)3 Period (com.axibase.tsd.api.model.Period)2 AggregationInterpolate (com.axibase.tsd.api.model.series.query.transformation.AggregationInterpolate)2 Group (com.axibase.tsd.api.model.series.query.transformation.group.Group)2 SeriesGroupInfo (com.axibase.tsd.api.model.series.SeriesGroupInfo)1 Aggregate (com.axibase.tsd.api.model.series.query.transformation.aggregate.Aggregate)1 AggregationType (com.axibase.tsd.api.model.series.query.transformation.aggregate.AggregationType)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1