Search in sources :

Example 56 with Series

use of com.srotya.sidewinder.core.storage.Series in project sidewinder by srotya.

the class TestSingleValueAggregators method testFirstFunctionLong.

@Test
public void testFirstFunctionLong() {
    FirstFunction f = new FirstFunction();
    long[] values = { 2, 1, 3, 4 };
    List<DataPoint> dps = new ArrayList<>();
    long ts = System.currentTimeMillis();
    for (long d : values) {
        dps.add(MiscUtils.buildDataPoint(ts, d));
    }
    Series series = new Series();
    series.setDataPoints(dps);
    Series result = f.apply(series);
    assertEquals(2, result.getDataPoints().get(0).getLongValue());
}
Also used : Series(com.srotya.sidewinder.core.storage.Series) DataPoint(com.srotya.sidewinder.core.storage.DataPoint) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

Series (com.srotya.sidewinder.core.storage.Series)56 DataPoint (com.srotya.sidewinder.core.storage.DataPoint)49 Test (org.junit.Test)47 ArrayList (java.util.ArrayList)37 TimeSeries (com.srotya.sidewinder.core.storage.TimeSeries)21 IOException (java.io.IOException)18 LinkedHashMap (java.util.LinkedHashMap)16 HashMap (java.util.HashMap)15 Point (com.srotya.sidewinder.core.rpc.Point)13 ItemNotFoundException (com.srotya.sidewinder.core.storage.ItemNotFoundException)13 File (java.io.File)13 ReducingWindowedAggregator (com.srotya.sidewinder.core.functions.windowed.ReducingWindowedAggregator)10 RejectException (com.srotya.sidewinder.core.storage.RejectException)10 StorageEngine (com.srotya.sidewinder.core.storage.StorageEngine)7 List (java.util.List)7 ByzantineWriter (com.srotya.sidewinder.core.storage.compression.byzantine.ByzantineWriter)6 Tag (com.srotya.sidewinder.core.filters.Tag)5 SimpleTagFilter (com.srotya.sidewinder.core.filters.SimpleTagFilter)4 Measurement (com.srotya.sidewinder.core.storage.Measurement)4 WriterServiceBlockingStub (com.srotya.sidewinder.core.rpc.WriterServiceGrpc.WriterServiceBlockingStub)3