Commit 3b6d6154 authored by Sören Henning's avatar Sören Henning

rename SimpleAlertStage

parent 0ef8ced7
package anomalydetection;
import java.io.PrintStream;
import anomalydetection.measurement.AnomalyScoredMeasurement;
import teetime.framework.AbstractConsumerStage;
public class SimpleAlertStage extends AbstractConsumerStage<AnomalyScoredMeasurement> {
public class AlertPrinterStage extends AbstractConsumerStage<AnomalyScoredMeasurement> {
private final PrintStream stream;
public AlertPrinterStage() {
this.stream = System.out;
}
public AlertPrinterStage(final PrintStream stream) {
this.stream = stream;
}
@Override
protected void execute(final AnomalyScoredMeasurement measurement) {
System.out.println("ALERT! Score: " + measurement.getAnomalyScore());
this.stream.println("ALERT! Score: " + measurement.getAnomalyScore());
}
}
......@@ -32,7 +32,7 @@ public class AnomalyDetectionConfiguration extends Configuration {
// ARIMAForecaster("192.168.99.100", 6311));
final AnomalyDetectionStage anomalyDetector = new AnomalyDetectionStage(Duration.ofHours(1), Duration.ofSeconds(5), new MeanAggregator(),
new RegressionForecaster());
final SimpleAlertStage alerter = new SimpleAlertStage();
final AlertPrinterStage alerter = new AlertPrinterStage();
final PrinterStage printer = new PrinterStage(); // TODO Temp
final JSONExportStage jsonExporter = new JSONExportStage(new File("values.json")); // TODO Temp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment