use of com.axibase.tsd.api.model.series.query.SeriesQuery in project atsd-api-test by axibase.
the class SeriesQueryMultipleAggregationTest method testSingleAggregatorFunctions.
@Issue("4717")
@Test(description = "test series query with single transformation functions", dataProvider = "provideSingleAggregatorFunctions")
public void testSingleAggregatorFunctions(AggregationType function, String[] expectedValues) throws Exception {
SeriesQuery query = createSeriesQuery(function);
List<Series> result = querySeriesAsList(query);
assertEquals(result.size(), 1, "Incorrect response series count");
List<Sample> resultSamples = result.get(0).getData();
assertEquals(resultSamples.size(), 2, "Incorrect response samples count");
assertSamples(resultSamples, expectedValues);
}
use of com.axibase.tsd.api.model.series.query.SeriesQuery in project atsd-api-test by axibase.
the class SeriesQueryTagExpressionFilterTest method testTagFilterWithSeriesLimit.
@Issue("3915")
@Test(dataProvider = "provideSingleTagFilters", description = "test tag expression with limit")
public void testTagFilterWithSeriesLimit(Filter<String> filter) throws Exception {
SeriesQuery query = new SeriesQuery(TEST_ENTITY, TEST_METRIC, Util.MIN_STORABLE_DATE, Util.MAX_STORABLE_DATE);
query.setTagExpression(filter.getExpression());
int expectedCount;
Set<String> expectedResultSet = filter.getExpectedResultSet();
if (expectedResultSet.size() > 1) {
query.setSeriesLimit(expectedResultSet.size() - 1);
expectedCount = expectedResultSet.size() - 1;
} else {
query.setSeriesLimit(1);
expectedCount = expectedResultSet.size();
}
Set<String> tagsSet = executeTagsQuery(query);
assertEquals(String.format("Incorrect result when using limit with tag expression %s", filter.getExpression()), expectedCount, tagsSet.size());
}
use of com.axibase.tsd.api.model.series.query.SeriesQuery in project atsd-api-test by axibase.
the class SeriesQueryTagExpressionFilterTest method checkQuery.
private void checkQuery(String filter, Set<String> expectedResult, String errorMessage) throws Exception {
Set<Object> expectedTagsSet = Sets.newHashSet(expectedResult);
SeriesQuery query = new SeriesQuery(TEST_ENTITY, TEST_METRIC, Util.MIN_STORABLE_DATE, Util.MAX_STORABLE_DATE);
query.setTagExpression(filter);
Set<String> actualTagsSet = executeTagsQuery(query);
assertEquals(String.format("%s filter %s", errorMessage, filter), expectedTagsSet, actualTagsSet);
}
use of com.axibase.tsd.api.model.series.query.SeriesQuery in project atsd-api-test by axibase.
the class SeriesQueryTransformationsLimitTest method testTwoDifferentQueriesWithInterpolateLimit.
@Issue("4836")
@Test(description = "test two different limited queries with interpolation")
public void testTwoDifferentQueriesWithInterpolateLimit() throws Exception {
SeriesQuery query1 = new SeriesQuery(ENTITY_1, METRIC, "2017-01-01T00:00:00Z", "2017-01-01T02:00:00Z");
query1.setInterpolate(INTERPOLATE);
SeriesQuery query2 = new SeriesQuery(ENTITY_2, METRIC, "2017-01-01T00:00:00Z", "2017-01-01T02:00:00Z");
query2.setInterpolate(INTERPOLATE);
checkResponse(query1, query2);
}
use of com.axibase.tsd.api.model.series.query.SeriesQuery in project atsd-api-test by axibase.
the class SeriesQueryTransformationsLimitTest method testGroupAndRateLimit.
@Issue("4835")
@Test(description = "test that limit is applied correctly after grouping and rate calculation")
public void testGroupAndRateLimit() throws Exception {
SeriesQuery query = new SeriesQuery("*", METRIC, "2017-01-01T00:00:00Z", "2017-01-01T02:00:00Z");
query.setEntities(ENTITIES);
GROUP.setOrder(1);
query.setGroup(GROUP);
RATE.setOrder(2);
query.setRate(RATE);
checkResponse(query);
}
Aggregations