Package io.openems.shared.influxdb
Class DbDataUtils
java.lang.Object
io.openems.shared.influxdb.DbDataUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic SortedMap
<ZonedDateTime, SortedMap<ChannelAddress, com.google.gson.JsonElement>> calculateLastMinusFirst
(SortedMap<ZonedDateTime, SortedMap<ChannelAddress, com.google.gson.JsonElement>> data, ZonedDateTime fromDate) Calculates the difference of the every values based on the last valid value and drops all values which are before the fromDate.static SortedMap
<ZonedDateTime, SortedMap<ChannelAddress, com.google.gson.JsonElement>> normalizeTable
(SortedMap<ZonedDateTime, SortedMap<ChannelAddress, com.google.gson.JsonElement>> table, Set<ChannelAddress> channels, Resolution resolution, ZonedDateTime fromDate, ZonedDateTime toDate) Normalizes the given table by adding null values for missing time stamps.
-
Method Details
-
normalizeTable
public static SortedMap<ZonedDateTime,SortedMap<ChannelAddress, normalizeTablecom.google.gson.JsonElement>> (SortedMap<ZonedDateTime, SortedMap<ChannelAddress, com.google.gson.JsonElement>> table, Set<ChannelAddress> channels, Resolution resolution, ZonedDateTime fromDate, ZonedDateTime toDate) Normalizes the given table by adding null values for missing time stamps.- Parameters:
table
- the datachannels
- the channelsresolution
- the resolutionfromDate
- the starting datetoDate
- the end date- Returns:
- the normalized table
-
calculateLastMinusFirst
public static SortedMap<ZonedDateTime,SortedMap<ChannelAddress, calculateLastMinusFirstcom.google.gson.JsonElement>> (SortedMap<ZonedDateTime, SortedMap<ChannelAddress, com.google.gson.JsonElement>> data, ZonedDateTime fromDate) Calculates the difference of the every values based on the last valid value and drops all values which are before the fromDate.- Parameters:
data
- the datafromDate
- the starting date- Returns:
- the differences of the values
-