@Test(expected = IllegalArgumentException.class) public void testDetect_nullMetricData() { detectorUnderTest.detect(null); }
@Override public DetectorResult detect(MetricData metricData) { notNull(metricData, "metricData can't be null"); val pointForecast = pointForecaster.forecast(metricData); if (pointForecast == null) { return new OutlierDetectorResult(AnomalyLevel.UNKNOWN); } else if (pointForecast.isWarmup()) { return new OutlierDetectorResult(true, AnomalyLevel.UNKNOWN); } val intervalForecast = intervalForecaster.forecast(metricData, pointForecast.getValue()); val thresholds = toAnomalyThresholds(intervalForecast); val observed = metricData.getValue(); val level = classifier.classify(thresholds, observed); val trusted = isTrusted(); return new OutlierDetectorResult(level) .setPredicted(pointForecast.getValue()) .setThresholds(thresholds) .setTrusted(trusted); }
ForecastingDetector extends AbstractOutlierDetector { @Override public DetectorResult detect(MetricData metricData) { notNull(metricData, "metricData can't be null"); val pointForecast = pointForecaster.forecast(metricData); if (pointForecast == null) { return new OutlierDetectorResult(AnomalyLevel.UNKNOWN); } else if (pointForecast.isWarmup()) { return new OutlierDetectorResult(true, AnomalyLevel.UNKNOWN); } val intervalForecast = intervalForecaster.forecast(metricData, pointForecast.getValue()); val thresholds = toAnomalyThresholds(intervalForecast); val observed = metricData.getValue(); val level = classifier.classify(thresholds, observed); val trusted = isTrusted(); return new OutlierDetectorResult(level) .setPredicted(pointForecast.getValue()) .setThresholds(thresholds) .setTrusted(trusted); } }
ForecastingDetector extends AbstractOutlierDetector { @Override public DetectorResult detect(MetricData metricData) { notNull(metricData, "metricData can't be null"); val pointForecast = pointForecaster.forecast(metricData); if (pointForecast == null) { return new OutlierDetectorResult(AnomalyLevel.UNKNOWN); } else if (pointForecast.isWarmup()) { return new OutlierDetectorResult(true, AnomalyLevel.UNKNOWN); } val intervalForecast = intervalForecaster.forecast(metricData, pointForecast.getValue()); val thresholds = toAnomalyThresholds(intervalForecast); val observed = metricData.getValue(); val level = classifier.classify(thresholds, observed); val trusted = isTrusted(); return new OutlierDetectorResult(level) .setPredicted(pointForecast.getValue()) .setThresholds(thresholds) .setTrusted(trusted); } ForecastingDetector(
            UUID uuid,
            PointForecaster pointForecaster,
            IntervalForecaster intervalForecaster,
            AnomalyType anomalyType,
            boolean trusted,
            String name); }
ForecastingDetector extends AbstractOutlierDetector { @Override public DetectorResult detect(MetricData metricData) { notNull(metricData, "metricData can't be null"); val pointForecast = pointForecaster.forecast(metricData); if (pointForecast == null) { return new OutlierDetectorResult(AnomalyLevel.UNKNOWN); } else if (pointForecast.isWarmup()) { return new OutlierDetectorResult(true, AnomalyLevel.UNKNOWN); } val intervalForecast = intervalForecaster.forecast(metricData, pointForecast.getValue()); val thresholds = toAnomalyThresholds(intervalForecast); val observed = metricData.getValue(); val level = classifier.classify(thresholds, observed); val trusted = isTrusted(); return new OutlierDetectorResult(level) .setPredicted(pointForecast.getValue()) .setThresholds(thresholds) .setTrusted(trusted); } ForecastingDetector(
            UUID uuid,
            PointForecaster pointForecaster,
            IntervalForecaster intervalForecaster,
            AnomalyType anomalyType,
            boolean trusted,
            String name); @Override DetectorResult detect(MetricData metricData); @Override String getName(); }
ForecastingDetector extends AbstractOutlierDetector { @Override public DetectorResult detect(MetricData metricData) { notNull(metricData, "metricData can't be null"); val pointForecast = pointForecaster.forecast(metricData); if (pointForecast == null) { return new OutlierDetectorResult(AnomalyLevel.UNKNOWN); } else if (pointForecast.isWarmup()) { return new OutlierDetectorResult(true, AnomalyLevel.UNKNOWN); } val intervalForecast = intervalForecaster.forecast(metricData, pointForecast.getValue()); val thresholds = toAnomalyThresholds(intervalForecast); val observed = metricData.getValue(); val level = classifier.classify(thresholds, observed); val trusted = isTrusted(); return new OutlierDetectorResult(level) .setPredicted(pointForecast.getValue()) .setThresholds(thresholds) .setTrusted(trusted); } ForecastingDetector(
            UUID uuid,
            PointForecaster pointForecaster,
            IntervalForecaster intervalForecaster,
            AnomalyType anomalyType,
            boolean trusted,
            String name); @Override DetectorResult detect(MetricData metricData); @Override String getName();  }