Search in sources :

Example 61 with Period

use of com.axibase.tsd.api.model.Period in project atsd-api-test by axibase.

the class SeriesQueryAggregateGroupOrderRateTest method testDefaultOrderGroupRate.

@Issue("4729")
@Test(description = "test query result with default Group/Rate order")
public void testDefaultOrderGroupRate() {
    SeriesQuery query = new SeriesQuery("*", TEST_METRIC, "2017-01-01T00:00:00Z", "2017-01-01T00:00:20Z");
    query.setGroup(new Group(GroupType.MAX, new Period(5, TimeUnit.SECOND)));
    query.setRate(new Rate(new Period(10, TimeUnit.SECOND)));
    Set<CheckedFields> actualFields = createCheckFields(querySeriesAsList(query));
    CheckedFields series = new CheckedFields("*", Arrays.asList(Sample.ofDateDecimal("2017-01-01T00:00:05.000Z", new BigDecimal("8.0")), Sample.ofDateDecimal("2017-01-01T00:00:10.000Z", new BigDecimal("12.0")), Sample.ofDateDecimal("2017-01-01T00:00:15.000Z", new BigDecimal("8.0"))));
    Set<CheckedFields> expectedFields = collectCheckFields(series);
    assertEquals(actualFields, expectedFields, "Incorrect query result with default Group/Rate order");
}
Also used : Group(com.axibase.tsd.api.model.series.query.transformation.group.Group) SeriesQuery(com.axibase.tsd.api.model.series.query.SeriesQuery) Rate(com.axibase.tsd.api.model.series.query.transformation.rate.Rate) Period(com.axibase.tsd.api.model.Period) BigDecimal(java.math.BigDecimal) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 62 with Period

use of com.axibase.tsd.api.model.Period in project atsd-api-test by axibase.

the class SeriesQueryAggregateGroupOrderRateTest method testAggregateSeriesLimit.

@Issue("4729")
@Test(description = "test query result with aggregate seriesLimit")
public void testAggregateSeriesLimit() {
    SeriesQuery query = new SeriesQuery("*", TEST_METRIC, "2017-01-01T00:00:00Z", "2017-01-01T00:00:20Z");
    query.setAggregate(new Aggregate(AggregationType.MIN, new Period(10, TimeUnit.SECOND)));
    query.setSeriesLimit(1);
    Set<CheckedFields> actualFields = createCheckFields(querySeriesAsList(query));
    CheckedFields series = new CheckedFields(TEST_ENTITY1, Arrays.asList(Sample.ofDateDecimal("2017-01-01T00:00:00.000Z", new BigDecimal("101.0")), Sample.ofDateDecimal("2017-01-01T00:00:10.000Z", new BigDecimal("111.0"))));
    Set<CheckedFields> expectedFields = collectCheckFields(series);
    assertEquals(actualFields, expectedFields, "Incorrect query result with aggregate seriesLimit");
}
Also used : 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) BigDecimal(java.math.BigDecimal) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 63 with Period

use of com.axibase.tsd.api.model.Period in project atsd-api-test by axibase.

the class TransformationPermutationsTest method setUpRate.

private void setUpRate() {
    Period period = new Period(1, TimeUnit.MINUTE);
    rateSettings = new Rate(period);
    rateSettings.setCounter(false);
    query.setRate(rateSettings);
}
Also used : Rate(com.axibase.tsd.api.model.series.query.transformation.rate.Rate) Period(com.axibase.tsd.api.model.Period)

Aggregations

Period (com.axibase.tsd.api.model.Period)63 Test (org.testng.annotations.Test)48 Issue (io.qameta.allure.Issue)44 SeriesQuery (com.axibase.tsd.api.model.series.query.SeriesQuery)39 Aggregate (com.axibase.tsd.api.model.series.query.transformation.aggregate.Aggregate)30 BigDecimal (java.math.BigDecimal)24 Group (com.axibase.tsd.api.model.series.query.transformation.group.Group)16 Series (com.axibase.tsd.api.model.series.Series)14 Rate (com.axibase.tsd.api.model.series.query.transformation.rate.Rate)11 AggregationInterpolate (com.axibase.tsd.api.model.series.query.transformation.AggregationInterpolate)10 PropertyQuery (com.axibase.tsd.api.model.property.PropertyQuery)7 Property (com.axibase.tsd.api.model.property.Property)6 MessageQuery (com.axibase.tsd.api.model.message.MessageQuery)5 MessageQuerySizeCheck (com.axibase.tsd.api.method.checks.MessageQuerySizeCheck)4 Message (com.axibase.tsd.api.model.message.Message)4 AggregationType (com.axibase.tsd.api.model.series.query.transformation.aggregate.AggregationType)3 ArrayList (java.util.ArrayList)3 Response (javax.ws.rs.core.Response)3 DataProvider (org.testng.annotations.DataProvider)3 Metric (com.axibase.tsd.api.model.metric.Metric)2