Class AnomalyDetector.AnomalyResult

java.lang.Object
com.nmontytskyi.monitoring.detector.AnomalyDetector.AnomalyResult
Enclosing class:
AnomalyDetector

public static final class AnomalyDetector.AnomalyResult extends Object
Immutable result of an anomaly analysis for a single measurement.
  • Method Details

    • of

      public static AnomalyDetector.AnomalyResult of(double zScore, boolean anomaly)
      Creates a result with sufficient data available.
      Parameters:
      zScore - computed Z-score value
      anomaly - true if the value is anomalous
    • insufficient

      public static AnomalyDetector.AnomalyResult insufficient()
      Returns a result indicating insufficient data for analysis. anomaly will be false, zScore will be 0.0.
    • getZScore

      public double getZScore()
      Returns:
      Z-score of the current value; 0.0 when data is insufficient
    • isAnomaly

      public boolean isAnomaly()
      Returns:
      true if the value is statistically anomalous
    • hasSufficientData

      public boolean hasSufficientData()
      Returns:
      true if there was enough data to perform the calculation
    • toString

      public String toString()
      Overrides:
      toString in class Object