java.lang.Object
org.rrd4j.data.Normalizer

class Normalizerextends Object
Normalizes RRD data timestamps and values to consistent intervals.
Handles alignment of time-series data to ensure regular sampling intervals and proper chronological ordering.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final int
    Number of data points in the series
    (package private) final long
    Time step in seconds between data points
    private final long[]
    Array of timestamps for the data series
  • Constructor Summary

    Constructors
    Constructor
    Description
    Normalizer(long[] timestamps)
    Derives the target sample count and step from the grid timestamps.
  • Method Summary

    Modifier and Type
    Method
    Description
    private static double[]
    getCopyOf(double[] rawValues)
    Copy of the values, NaN for missing.
    (package private) double[]
    normalize(long[] rawTimestamps, double[] rawValues)
    Normalize timestamps and values to the target interval

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • timestamps

      private final long[] timestamps
      Array of timestamps for the data series
    • count

      final int count
      Number of data points in the series
    • step

      final long step
      Time 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 step
      rawValues - 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