Search in sources :

Example 1 with PointValueField

use of com.infiniteautomation.mango.rest.latest.model.pointValue.PointValueField in project ma-modules-public by infiniteautomation.

the class MultiPointStatisticsStreamTest method testSingleNumericPointOnlyCacheChangeCachedValueAtFrom.

@Test
public void testSingleNumericPointOnlyCacheChangeCachedValueAtFrom() throws IOException, QueryCancelledException {
    // Setup the data to run once daily for 30 days
    ZonedDateTime from = ZonedDateTime.of(2017, 01, 01, 00, 00, 00, 0, zoneId);
    ZonedDateTime to = ZonedDateTime.of(2017, 02, 01, 00, 00, 00, 0, zoneId);
    NextTimePeriodAdjuster adjuster = new NextTimePeriodAdjuster(TimePeriods.DAYS, 1);
    int cacheSize = 10;
    MockDataSourceVO ds = createDataSource();
    DataPointVO dp = createDataPoint(ds.getId(), DataType.NUMERIC, cacheSize);
    DataPointWrapper<AnalogStatistics> point = new DataPointWrapper<AnalogStatistics>(ds, dp, new PointValueTime(1.0, 0), (value) -> {
        return new NumericValue(value.getDoubleValue() + 1.0);
    }, (info, w) -> {
        return new AnalogStatistics(info.getFromMillis(), info.getToMillis(), w.values.get(0), w.values);
    }, new AnalogStatisticsVerifier());
    // Insert the data skipping first day so we get the initial value
    ZonedDateTime time = (ZonedDateTime) adjuster.adjustInto(from);
    timer.setStartTime(time.toInstant().toEpochMilli());
    while (time.toInstant().isBefore(to.toInstant())) {
        point.updatePointValue(new PointValueTime(point.getNextValue(), time.toInstant().toEpochMilli()));
        time = (ZonedDateTime) adjuster.adjustInto(time);
        timer.fastForwardTo(time.toInstant().toEpochMilli());
    }
    // Insert some values directly into the cache
    point.values.clear();
    for (int i = 0; i < cacheSize; i++) {
        time = (ZonedDateTime) adjuster.adjustInto(time);
        timer.fastForwardTo(time.toInstant().toEpochMilli());
        point.saveOnlyToCache(new AnnotatedPointValueTime(point.getNextValue(), timer.currentTimeMillis(), new TranslatableMessage("common.default", "testing")));
    }
    // Ensure we get all the data
    from = ZonedDateTime.ofInstant(Instant.ofEpochMilli(point.values.get(0).getTime()), zoneId);
    Instant now = Instant.ofEpochMilli(timer.currentTimeMillis() + 1);
    to = ZonedDateTime.ofInstant(now, zoneId);
    // Perform the query
    String dateTimeFormat = null;
    String timezone = zoneId.getId();
    PointValueTimeCacheControl cache = PointValueTimeCacheControl.CACHE_ONLY;
    PointValueField[] fields = getFields();
    ZonedDateTimeStatisticsQueryInfo info = new ZonedDateTimeStatisticsQueryInfo(from, to, dateTimeFormat, timezone, cache, fields);
    test(info, point);
}
Also used : DataPointVO(com.serotonin.m2m2.vo.DataPointVO) MockDataSourceVO(com.serotonin.m2m2.vo.dataSource.mock.MockDataSourceVO) Instant(java.time.Instant) AnalogStatistics(com.infiniteautomation.mango.statistics.AnalogStatistics) ZonedDateTime(java.time.ZonedDateTime) AnnotatedPointValueTime(com.serotonin.m2m2.rt.dataImage.AnnotatedPointValueTime) PointValueTime(com.serotonin.m2m2.rt.dataImage.PointValueTime) AnnotatedPointValueTime(com.serotonin.m2m2.rt.dataImage.AnnotatedPointValueTime) TranslatableMessage(com.serotonin.m2m2.i18n.TranslatableMessage) NumericValue(com.serotonin.m2m2.rt.dataImage.types.NumericValue) NextTimePeriodAdjuster(com.infiniteautomation.mango.util.datetime.NextTimePeriodAdjuster) PointValueField(com.infiniteautomation.mango.rest.latest.model.pointValue.PointValueField) Test(org.junit.Test)

Example 2 with PointValueField

use of com.infiniteautomation.mango.rest.latest.model.pointValue.PointValueField in project ma-modules-public by infiniteautomation.

the class MultiPointStatisticsStreamTest method testMultiplePointsOnlyCacheChange.

@Test
public void testMultiplePointsOnlyCacheChange() throws IOException, QueryCancelledException {
    // Setup the data to run once daily for 30 days
    ZonedDateTime from = ZonedDateTime.of(2017, 01, 01, 00, 00, 00, 0, zoneId);
    ZonedDateTime to = ZonedDateTime.of(2017, 02, 01, 00, 00, 00, 0, zoneId);
    NextTimePeriodAdjuster adjuster = new NextTimePeriodAdjuster(TimePeriods.DAYS, 1);
    int cacheSize = 10;
    MockDataSourceVO ds = createDataSource();
    DataPointVO numericDp = createDataPoint(ds.getId(), DataType.NUMERIC, cacheSize);
    DataPointWrapper<AnalogStatistics> numericPoint = new DataPointWrapper<AnalogStatistics>(ds, numericDp, new PointValueTime(1.0, 0), (value) -> {
        return new NumericValue(value.getDoubleValue() + 1.0);
    }, (info, w) -> {
        return new AnalogStatistics(info.getFromMillis(), info.getToMillis(), null, w.values);
    }, (w, gen, root) -> {
        JsonNode stats = root.get(w.vo.getXid());
        if (stats == null)
            fail("Missing stats for point " + w.vo.getXid());
        JsonNode stat = stats.get(PointValueTimeWriter.START);
        if (stat == null)
            fail("Missing " + PointValueTimeWriter.START + " entry");
        assertNull(gen.getStartValue());
        assertTrue(stat.isNull());
        stat = stats.get(PointValueTimeWriter.FIRST);
        if (stat == null)
            fail("Missing " + PointValueTimeWriter.FIRST + " entry");
        PointValueTime value = getPointValueTime(w.vo.getPointLocator().getDataType(), stat);
        assertEquals(gen.getFirstValue(), value.getValue().getDoubleValue(), 0.00001);
        assertEquals((long) gen.getFirstTime(), value.getTime());
        stat = stats.get(PointValueTimeWriter.LAST);
        if (stat == null)
            fail("Missing " + PointValueTimeWriter.LAST + " entry");
        value = getPointValueTime(w.vo.getPointLocator().getDataType(), stat);
        assertEquals(gen.getLastValue(), value.getValue().getDoubleValue(), 0.00001);
        assertEquals((long) gen.getLastTime(), value.getTime());
        stat = stats.get(PointValueTimeWriter.COUNT);
        if (stat == null)
            fail("Missing " + PointValueTimeWriter.COUNT + " entry");
        assertEquals(gen.getCount(), stat.asInt());
        stat = stats.get(PointValueTimeWriter.ACCUMULATOR);
        if (stat == null)
            fail("Missing " + PointValueTimeWriter.ACCUMULATOR + " entry");
        value = getPointValueTime(w.vo.getPointLocator().getDataType(), stat);
        Double accumulatorValue = gen.getLastValue();
        if (accumulatorValue == null)
            accumulatorValue = gen.getMaximumValue();
        assertEquals(accumulatorValue, value.getDoubleValue(), 0.00001);
        stat = stats.get(PointValueTimeWriter.AVERAGE);
        if (stat == null)
            fail("Missing " + PointValueTimeWriter.AVERAGE + " entry");
        value = getPointValueTime(w.vo.getPointLocator().getDataType(), stat);
        assertEquals(gen.getAverage(), value.getDoubleValue(), 0.00001);
        stat = stats.get(PointValueTimeWriter.DELTA);
        if (stat == null)
            fail("Missing " + PointValueTimeWriter.DELTA + " entry");
        value = getPointValueTime(w.vo.getPointLocator().getDataType(), stat);
        assertEquals(gen.getDelta(), value.getDoubleValue(), 0.00001);
        stat = stats.get(PointValueTimeWriter.MINIMUM);
        if (stat == null)
            fail("Missing " + PointValueTimeWriter.MINIMUM + " entry");
        value = getPointValueTime(w.vo.getPointLocator().getDataType(), stat);
        assertEquals(gen.getMinimumValue(), value.getValue().getDoubleValue(), 0.00001);
        assertEquals((long) gen.getMinimumTime(), value.getTime());
        stat = stats.get(PointValueTimeWriter.MAXIMUM);
        if (stat == null)
            fail("Missing " + PointValueTimeWriter.MAXIMUM + " entry");
        value = getPointValueTime(w.vo.getPointLocator().getDataType(), stat);
        assertEquals(gen.getMaximumValue(), value.getValue().getDoubleValue(), 0.00001);
        assertEquals((long) gen.getMaximumTime(), value.getTime());
        stat = stats.get(PointValueTimeWriter.SUM);
        if (stat == null)
            fail("Missing " + PointValueTimeWriter.SUM + " entry");
        value = getPointValueTime(w.vo.getPointLocator().getDataType(), stat);
        assertEquals(gen.getSum(), value.getDoubleValue(), 0.00001);
        stat = stats.get(PointValueTimeWriter.INTEGRAL);
        if (stat == null)
            fail("Missing " + PointValueTimeWriter.INTEGRAL + " entry");
        value = getPointValueTime(w.vo.getPointLocator().getDataType(), stat);
        assertEquals(gen.getIntegral(), value.getDoubleValue(), 0.00001);
    });
    DataPointVO multistateDp = createDataPoint(ds.getId(), DataType.MULTISTATE, cacheSize);
    DataPointWrapper<StartsAndRuntimeList> multistatePoint = new DataPointWrapper<StartsAndRuntimeList>(ds, multistateDp, new PointValueTime(1, 0), (value) -> {
        return new MultistateValue(value.getIntegerValue() + 1);
    }, (info, w) -> {
        return new StartsAndRuntimeList(info.getFromMillis(), info.getToMillis(), null, w.values);
    }, (w, gen, root) -> {
        JsonNode stats = root.get(w.vo.getXid());
        if (stats == null)
            fail("Missing stats for point " + w.vo.getXid());
        JsonNode stat = stats.get(PointValueTimeWriter.START);
        if (stat == null)
            fail("Missing " + PointValueTimeWriter.START + " entry");
        assertNull(gen.getStartValue());
        assertTrue(stat.isNull());
        stat = stats.get(PointValueTimeWriter.FIRST);
        if (stat == null)
            fail("Missing " + PointValueTimeWriter.FIRST + " entry");
        PointValueTime value = getPointValueTime(w.vo.getPointLocator().getDataType(), stat);
        assertEquals(gen.getFirstValue(), value.getValue());
        assertEquals((long) gen.getFirstTime(), value.getTime());
        stat = stats.get(PointValueTimeWriter.LAST);
        if (stat == null)
            fail("Missing " + PointValueTimeWriter.LAST + " entry");
        value = getPointValueTime(w.vo.getPointLocator().getDataType(), stat);
        assertEquals(gen.getLastValue(), value.getValue());
        assertEquals((long) gen.getLastTime(), value.getTime());
        stat = stats.get(PointValueTimeWriter.COUNT);
        if (stat == null)
            fail("Missing " + PointValueTimeWriter.COUNT + " entry");
        assertEquals(gen.getCount(), stat.asInt());
        // Test data
        stat = stats.get(PointValueTimeWriter.STARTS_AND_RUNTIMES);
        if (stat == null)
            fail("Missing data entry");
        for (int i = 0; i < gen.getData().size(); i++) {
            StartsAndRuntime expected = gen.getData().get(i);
            JsonNode actual = stat.get(i);
            assertEquals((int) expected.getValue(), actual.get(PointValueTimeWriter.VALUE).intValue());
            assertEquals(expected.getStarts(), actual.get(PointValueTimeWriter.STARTS).intValue());
            assertEquals(expected.getRuntime(), actual.get(PointValueTimeWriter.RUNTIME).asLong());
            assertEquals(expected.getProportion(), actual.get(PointValueTimeWriter.PROPORTION).doubleValue(), 0.000001);
        }
    });
    // Insert the data skipping first day so we get the initial value
    ZonedDateTime time = (ZonedDateTime) adjuster.adjustInto(from);
    timer.setStartTime(time.toInstant().toEpochMilli());
    while (time.toInstant().isBefore(to.toInstant())) {
        numericPoint.updatePointValue(new PointValueTime(numericPoint.getNextValue(), time.toInstant().toEpochMilli()));
        multistatePoint.updatePointValue(new PointValueTime(multistatePoint.getNextValue(), time.toInstant().toEpochMilli()));
        time = (ZonedDateTime) adjuster.adjustInto(time);
        timer.fastForwardTo(time.toInstant().toEpochMilli());
    }
    // Insert some values directly into the cache
    numericPoint.values.clear();
    multistatePoint.values.clear();
    for (int i = 0; i < cacheSize; i++) {
        time = (ZonedDateTime) adjuster.adjustInto(time);
        timer.fastForwardTo(time.toInstant().toEpochMilli());
        numericPoint.saveOnlyToCache(new PointValueTime(numericPoint.getNextValue(), timer.currentTimeMillis()));
        multistatePoint.saveOnlyToCache(new PointValueTime(multistatePoint.getNextValue(), timer.currentTimeMillis()));
    }
    // Ensure we get all the data
    Instant now = Instant.ofEpochMilli(timer.currentTimeMillis() + 1);
    to = ZonedDateTime.ofInstant(now, zoneId);
    // Perform the query
    String dateTimeFormat = null;
    String timezone = zoneId.getId();
    PointValueTimeCacheControl cache = PointValueTimeCacheControl.CACHE_ONLY;
    PointValueField[] fields = getFields();
    ZonedDateTimeStatisticsQueryInfo info = new ZonedDateTimeStatisticsQueryInfo(from, to, dateTimeFormat, timezone, cache, fields);
    test(info, numericPoint, multistatePoint);
}
Also used : DataPointVO(com.serotonin.m2m2.vo.DataPointVO) MockDataSourceVO(com.serotonin.m2m2.vo.dataSource.mock.MockDataSourceVO) Instant(java.time.Instant) AnalogStatistics(com.infiniteautomation.mango.statistics.AnalogStatistics) JsonNode(com.fasterxml.jackson.databind.JsonNode) MultistateValue(com.serotonin.m2m2.rt.dataImage.types.MultistateValue) StartsAndRuntime(com.infiniteautomation.mango.statistics.StartsAndRuntime) ZonedDateTime(java.time.ZonedDateTime) StartsAndRuntimeList(com.infiniteautomation.mango.statistics.StartsAndRuntimeList) AnnotatedPointValueTime(com.serotonin.m2m2.rt.dataImage.AnnotatedPointValueTime) PointValueTime(com.serotonin.m2m2.rt.dataImage.PointValueTime) NumericValue(com.serotonin.m2m2.rt.dataImage.types.NumericValue) NextTimePeriodAdjuster(com.infiniteautomation.mango.util.datetime.NextTimePeriodAdjuster) PointValueField(com.infiniteautomation.mango.rest.latest.model.pointValue.PointValueField) Test(org.junit.Test)

Example 3 with PointValueField

use of com.infiniteautomation.mango.rest.latest.model.pointValue.PointValueField in project ma-modules-public by infiniteautomation.

the class MultiPointStatisticsStream method processRow.

@Override
protected void processRow(IdPointValueTime value, boolean firstBookend, boolean lastBookend, boolean cached) throws QueryCancelledException {
    try {
        final DataPointVO vo = voMap.get(value.getSeriesId());
        if (info.isUseCache() != PointValueTimeCacheControl.NONE && !cached)
            if (!processValueThroughCache(value, firstBookend, lastBookend))
                return;
        StatisticsGenerator generator = statsMap.compute(value.getSeriesId(), (k, v) -> {
            if (v == null) {
                switch(vo.getPointLocator().getDataType()) {
                    case BINARY:
                    case MULTISTATE:
                        v = new StartsAndRuntimeList(info.getFromMillis(), info.getToMillis(), value);
                        break;
                    case ALPHANUMERIC:
                        v = new ValueChangeCounter(info.getFromMillis(), info.getToMillis(), value);
                        break;
                    case NUMERIC:
                        v = new AnalogStatistics(info.getFromMillis(), info.getToMillis(), value);
                        break;
                    default:
                        throw new ShouldNeverHappenException("Invalid Data Type: " + voMap.get(value.getSeriesId()).getPointLocator().getDataType());
                }
            }
            if (!lastBookend && !firstBookend) {
                v.addValueTime(value);
            }
            return v;
        });
        if (lastBookend) {
            generator.done();
            this.writer.writeStartObject(vo.getXid());
            DataPointStatisticsGenerator gen = new DataPointStatisticsGenerator(vo, generator);
            // Pre-process the fields
            boolean rendered = false;
            Set<PointValueField> fields = new HashSet<>();
            for (PointValueField field : this.writer.getInfo().getFields()) {
                if (field == PointValueField.RENDERED) {
                    rendered = true;
                } else if (field == PointValueField.ANNOTATION) {
                    continue;
                } else {
                    fields.add(field);
                }
            }
            // Remove the Value field we will write it after
            fields.remove(PointValueField.VALUE);
            for (PointValueField field : fields) {
                field.writeValue(gen, info, Common.getTranslations(), false, writer);
            }
            this.writer.writeAllStatistics(generator, vo, rendered, fields.contains(PointValueField.RAW));
            this.writer.writeEndObject();
        }
    } catch (IOException e) {
        throw new QueryCancelledException(e);
    }
}
Also used : DataPointVO(com.serotonin.m2m2.vo.DataPointVO) DataPointStatisticsGenerator(com.infiniteautomation.mango.rest.latest.model.pointValue.quantize.DataPointStatisticsGenerator) AnalogStatistics(com.infiniteautomation.mango.statistics.AnalogStatistics) IOException(java.io.IOException) StatisticsGenerator(com.serotonin.m2m2.view.stats.StatisticsGenerator) DataPointStatisticsGenerator(com.infiniteautomation.mango.rest.latest.model.pointValue.quantize.DataPointStatisticsGenerator) StartsAndRuntimeList(com.infiniteautomation.mango.statistics.StartsAndRuntimeList) ValueChangeCounter(com.infiniteautomation.mango.statistics.ValueChangeCounter) ShouldNeverHappenException(com.serotonin.ShouldNeverHappenException) QueryCancelledException(com.infiniteautomation.mango.db.query.QueryCancelledException) PointValueField(com.infiniteautomation.mango.rest.latest.model.pointValue.PointValueField) HashSet(java.util.HashSet)

Example 4 with PointValueField

use of com.infiniteautomation.mango.rest.latest.model.pointValue.PointValueField in project ma-modules-public by infiniteautomation.

the class MultiPointStatisticsStreamTest method testSingleNumericPointNoCacheNoChangeInitialValue.

@Test
public void testSingleNumericPointNoCacheNoChangeInitialValue() {
    // Setup the data to run once daily for 30 days
    ZonedDateTime from = ZonedDateTime.of(2017, 1, 1, 0, 0, 0, 0, zoneId);
    ZonedDateTime to = ZonedDateTime.of(2017, 2, 1, 0, 0, 0, 0, zoneId);
    Duration adjuster = Duration.ofDays(1);
    MockDataSourceVO ds = createDataSource();
    DataPointVO dp = createDataPoint(ds.getId(), DataType.NUMERIC, 1);
    DataPointWrapper<AnalogStatistics> wrapper = new DataPointWrapper<>(ds, dp, new PointValueTime(1.0, 0), // no change
    Function.identity(), (w) -> new AnalogStatistics(from.toInstant().toEpochMilli(), to.toInstant().toEpochMilli(), w.initialValue, w.values), new AnalogStatisticsVerifier());
    // Insert the data skipping first day so we get the initial value
    ZonedDateTime time = from.plus(adjuster);
    timer.setStartTime(time.toInstant().toEpochMilli());
    while (time.toInstant().isBefore(to.toInstant())) {
        wrapper.updatePointValue(new PointValueTime(wrapper.getNextValue(), time.toInstant().toEpochMilli()));
        time = time.plus(adjuster);
        timer.fastForwardTo(time.toInstant().toEpochMilli());
    }
    // Perform the query
    String timezone = zoneId.getId();
    PointValueField[] fields = getFields();
    var result = getStatistics(List.of(dp), from, to, timezone, fields);
    test(result, wrapper);
}
Also used : DataPointVO(com.serotonin.m2m2.vo.DataPointVO) MockDataSourceVO(com.serotonin.m2m2.vo.dataSource.mock.MockDataSourceVO) AnalogStatistics(com.infiniteautomation.mango.statistics.AnalogStatistics) Duration(java.time.Duration) ZonedDateTime(java.time.ZonedDateTime) PointValueTime(com.serotonin.m2m2.rt.dataImage.PointValueTime) PointValueField(com.infiniteautomation.mango.rest.latest.model.pointValue.PointValueField) Test(org.junit.Test)

Example 5 with PointValueField

use of com.infiniteautomation.mango.rest.latest.model.pointValue.PointValueField in project ma-modules-public by infiniteautomation.

the class MultiPointStatisticsStreamTest method testMultiplePointsNoCacheChangeInitialValue.

@Test
public void testMultiplePointsNoCacheChangeInitialValue() {
    // Setup the data to run once daily for 30 days
    ZonedDateTime from = ZonedDateTime.of(2017, 1, 1, 0, 0, 0, 0, zoneId);
    ZonedDateTime to = ZonedDateTime.of(2017, 2, 1, 0, 0, 0, 0, zoneId);
    Duration adjuster = Duration.ofDays(1);
    MockDataSourceVO ds = createDataSource();
    DataPointVO numericDp = createDataPoint(ds.getId(), DataType.NUMERIC, 1);
    DataPointWrapper<AnalogStatistics> numericWrapper = new DataPointWrapper<>(ds, numericDp, new PointValueTime(1.0, 0), (value) -> new NumericValue(value.getDoubleValue() + 1.0), (w) -> new AnalogStatistics(from.toInstant().toEpochMilli(), to.toInstant().toEpochMilli(), w.initialValue, w.values), new AnalogStatisticsVerifier());
    DataPointVO multistateDp = createDataPoint(ds.getId(), DataType.MULTISTATE, 1);
    DataPointWrapper<StartsAndRuntimeList> multistateWrapper = new DataPointWrapper<>(ds, multistateDp, new PointValueTime(1, 0), (value) -> new MultistateValue(value.getIntegerValue() + 1), (w) -> new StartsAndRuntimeList(from.toInstant().toEpochMilli(), to.toInstant().toEpochMilli(), w.initialValue, w.values), new StartsAndRuntimeListVerifier());
    // Insert the data skipping first day so we get the initial value
    ZonedDateTime time = from.plus(adjuster);
    timer.setStartTime(time.toInstant().toEpochMilli());
    while (time.toInstant().isBefore(to.toInstant())) {
        numericWrapper.updatePointValue(new PointValueTime(numericWrapper.getNextValue(), time.toInstant().toEpochMilli()));
        multistateWrapper.updatePointValue(new PointValueTime(multistateWrapper.getNextValue(), time.toInstant().toEpochMilli()));
        time = time.plus(adjuster);
        timer.fastForwardTo(time.toInstant().toEpochMilli());
    }
    // Perform the query
    String timezone = zoneId.getId();
    PointValueField[] fields = getFields();
    var result = getStatistics(List.of(numericDp, multistateDp), from, to, timezone, fields);
    test(result, numericWrapper, multistateWrapper);
}
Also used : DataPointVO(com.serotonin.m2m2.vo.DataPointVO) MockDataSourceVO(com.serotonin.m2m2.vo.dataSource.mock.MockDataSourceVO) AnalogStatistics(com.infiniteautomation.mango.statistics.AnalogStatistics) Duration(java.time.Duration) MultistateValue(com.serotonin.m2m2.rt.dataImage.types.MultistateValue) ZonedDateTime(java.time.ZonedDateTime) StartsAndRuntimeList(com.infiniteautomation.mango.statistics.StartsAndRuntimeList) PointValueTime(com.serotonin.m2m2.rt.dataImage.PointValueTime) NumericValue(com.serotonin.m2m2.rt.dataImage.types.NumericValue) PointValueField(com.infiniteautomation.mango.rest.latest.model.pointValue.PointValueField) Test(org.junit.Test)

Aggregations

PointValueField (com.infiniteautomation.mango.rest.latest.model.pointValue.PointValueField)13 DataPointVO (com.serotonin.m2m2.vo.DataPointVO)13 PointValueTime (com.serotonin.m2m2.rt.dataImage.PointValueTime)11 ZonedDateTime (java.time.ZonedDateTime)11 MockDataSourceVO (com.serotonin.m2m2.vo.dataSource.mock.MockDataSourceVO)10 Test (org.junit.Test)10 AnalogStatistics (com.infiniteautomation.mango.statistics.AnalogStatistics)9 NumericValue (com.serotonin.m2m2.rt.dataImage.types.NumericValue)8 Duration (java.time.Duration)7 StartsAndRuntimeList (com.infiniteautomation.mango.statistics.StartsAndRuntimeList)5 AnnotatedPointValueTime (com.serotonin.m2m2.rt.dataImage.AnnotatedPointValueTime)5 Instant (java.time.Instant)5 JsonNode (com.fasterxml.jackson.databind.JsonNode)4 NextTimePeriodAdjuster (com.infiniteautomation.mango.util.datetime.NextTimePeriodAdjuster)4 MultistateValue (com.serotonin.m2m2.rt.dataImage.types.MultistateValue)4 RollupEnum (com.infiniteautomation.mango.rest.latest.model.pointValue.RollupEnum)3 ValueChangeCounter (com.infiniteautomation.mango.statistics.ValueChangeCounter)3 Map (java.util.Map)3 AggregateValueMapper (com.infiniteautomation.mango.rest.latest.streamingvalues.mapper.AggregateValueMapper)2 StreamMapperBuilder (com.infiniteautomation.mango.rest.latest.streamingvalues.mapper.StreamMapperBuilder)2