Search in sources :

Example 6 with MessageStatsQuery

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

the class MessageQueryStatsTest method testAggregateCount.

@Issue("2945")
@Test(enabled = false)
public void testAggregateCount() throws Exception {
    MessageStatsQuery statsQuery = prepareSimpleMessageStatsQuery(MESSAGE_STATS_ENTITY);
    statsQuery.setAggregate(new Aggregate(AggregationType.COUNT));
    List<Series> messageStatsList = queryMessageStatsReturnSeries(statsQuery);
    assertEquals("Response should contain only 1 series", 1, messageStatsList.size());
    List<Sample> samples = messageStatsList.get(0).getData();
    assertEquals("Response should contain only 1 sample", 1, samples.size());
    assertEquals("Message count mismatch", new BigDecimal(DATES.size()), samples.get(0).getValue());
}
Also used : MessageStatsQuery(com.axibase.tsd.api.model.message.MessageStatsQuery) Series(com.axibase.tsd.api.model.series.Series) Sample(com.axibase.tsd.api.model.series.Sample) 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)

Aggregations

MessageStatsQuery (com.axibase.tsd.api.model.message.MessageStatsQuery)6 Issue (io.qameta.allure.Issue)5 Test (org.testng.annotations.Test)5 Aggregate (com.axibase.tsd.api.model.series.query.transformation.aggregate.Aggregate)4 Sample (com.axibase.tsd.api.model.series.Sample)3 Series (com.axibase.tsd.api.model.series.Series)3 BigDecimal (java.math.BigDecimal)3 Response (javax.ws.rs.core.Response)2