Search in sources :

Example 11 with AggregationInterpolate

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

Example 12 with AggregationInterpolate

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

the class SeriesQueryTest method testAggregateInterpolateNoTypeRaiseError.

@Issue("3324")
@Test
public void testAggregateInterpolateNoTypeRaiseError() throws Exception {
    SeriesQuery query = new SeriesQuery("mock-entity", "mock-metric", MIN_QUERYABLE_DATE, MAX_QUERYABLE_DATE);
    Aggregate aggregate = new Aggregate(AggregationType.SUM, new Period(99999, TimeUnit.QUARTER));
    aggregate.setInterpolate(new AggregationInterpolate());
    query.setAggregate(aggregate);
    Response response = querySeries(query);
    assertEquals("Query with interpolation but without type should fail", BAD_REQUEST.getStatusCode(), response.getStatus());
    assertEquals("Error message mismatch", INTERPOLATE_TYPE_REQUIRED, extractErrorMessage(response));
}
Also used : Response(javax.ws.rs.core.Response) SeriesQuery(com.axibase.tsd.api.model.series.query.SeriesQuery) Period(com.axibase.tsd.api.model.Period) Aggregate(com.axibase.tsd.api.model.series.query.transformation.aggregate.Aggregate) AggregationInterpolate(com.axibase.tsd.api.model.series.query.transformation.AggregationInterpolate) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Aggregations

AggregationInterpolate (com.axibase.tsd.api.model.series.query.transformation.AggregationInterpolate)12 Period (com.axibase.tsd.api.model.Period)8 SeriesQuery (com.axibase.tsd.api.model.series.query.SeriesQuery)7 Group (com.axibase.tsd.api.model.series.query.transformation.group.Group)7 Issue (io.qameta.allure.Issue)7 Test (org.testng.annotations.Test)7 Aggregate (com.axibase.tsd.api.model.series.query.transformation.aggregate.Aggregate)5 AggregationType (com.axibase.tsd.api.model.series.query.transformation.aggregate.AggregationType)3 GroupType (com.axibase.tsd.api.model.series.query.transformation.group.GroupType)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Response (javax.ws.rs.core.Response)2 Series (com.axibase.tsd.api.model.series.Series)1 BigDecimal (java.math.BigDecimal)1