use of com.axibase.tsd.api.model.series.query.transformation.interpolate.Interpolate in project atsd-api-test by axibase.
the class SeriesQueryTest method testEndTimeInterpolation.
@Issue("4867")
@Test(description = "test END_TIME period align interpolation")
public void testEndTimeInterpolation() {
SeriesQuery query = new SeriesQuery(TEST_SERIES3.getEntity(), TEST_SERIES3.getMetric());
query.setStartDate("2017-01-01T00:00:50Z");
query.setEndDate("2017-01-01T00:03:30Z");
query.setInterpolate(new Interpolate(InterpolateFunction.LINEAR, new Period(1, TimeUnit.MINUTE, PeriodAlignment.END_TIME)));
List<Series> result = SeriesMethod.querySeriesAsList(query);
Series expectedSeries = new Series();
expectedSeries.setEntity(TEST_SERIES3.getEntity());
expectedSeries.setMetric(TEST_SERIES3.getMetric());
expectedSeries.setTags(Mocks.TAGS);
expectedSeries.addSamples(Sample.ofDateDecimal("2017-01-01T00:01:30Z", new BigDecimal("1.5")), Sample.ofDateDecimal("2017-01-01T00:02:30Z", new BigDecimal("2.5")));
assertEquals("Incorrect query result with END_TIME period align interpolation", 1, result.size());
assertEquals("Incorrect query result with END_TIME period align interpolation", expectedSeries, result.get(0));
}
Aggregations