java.lang.Object
org.rrd4j.data.Normalizer
Normalizes RRD data timestamps and values to consistent intervals.
Handles alignment of time-series data to ensure regular sampling intervals and proper chronological ordering.
Handles alignment of time-series data to ensure regular sampling intervals and proper chronological ordering.
Field Summary
FieldsModifier and TypeFieldDescription(package private) final intNumber of data points in the series(package private) final longTime step in seconds between data pointsprivate final long[]Array of timestamps for the data seriesConstructor Summary
ConstructorsConstructorDescriptionNormalizer(long[] timestamps) Derives the target sample count and step from the grid timestamps.Method Summary
Field Details
timestamps
private final long[] timestampsArray of timestamps for the data seriescount
final int countNumber of data points in the seriesstep
final long stepTime step in seconds between data points
Constructor Details
Normalizer
Normalizer(long[] timestamps) Derives the target sample count and step from the grid timestamps.- Parameters:
timestamps- timestamps defining the target grid
Method Details
normalize
double[] normalize(long[] rawTimestamps, double[] rawValues) Normalize timestamps and values to the target interval- Parameters:
rawTimestamps- the source sample times in seconds, evenly spaced at their own steprawValues- the source sample values, one per entry of rawTimestamps- Returns:
- the source values resampled onto this grid, NaN where no source sample overlaps
getCopyOf
private static double[] getCopyOf(double[] rawValues) Copy of the values, NaN for missing.- Parameters:
rawValues- the values to copy, left unmodified- Returns:
- a copy of rawValues