Skip to content
Snippets Groups Projects

Anomaly detection filter

Merged Ghost User requested to merge AnomalyDetectionFilter into master
+ 175
28
Compare changes
  • Side-by-side
  • Inline
Files
@@ -23,7 +23,7 @@ import kieker.tools.opad.record.StorableDetectionResult;
/**
*
* This filter separates input values by their reach of a certain threshold (parameter). It takes events of type {@link StorableDetectionResult} and channels them
* into two output ports, depending on whether the threshold was reached or not. This filter has configuration properties for the (critical) threshold. Although the
* into the output port, depending on whether the threshold was reached or not. This filter has configuration properties for the (critical) threshold. Although the
* configuration of the critical threshold is possible, the value is currently not used by the filter.
*
* @author Tillmann Carlos Bielefeld, Thomas Duellmann, Tobias Rudolph, Arne Jan Salveter
@@ -32,20 +32,20 @@ import kieker.tools.opad.record.StorableDetectionResult;
*/
public class AnomalyDetectionFilter extends AbstractConsumerStage<StorableDetectionResult> {
/** The output port delivering the normal score if it remains below the threshold. */
private final OutputPort<StorableDetectionResult> outputPortNormal = this.createOutputPort();
/** The output port delivering the abnormal score if it exceeds or equals the threshold. */
private final OutputPort<StorableDetectionResult> outputPortAnnormal = this.createOutputPort();
private final OutputPort<StorableDetectionResult> outputPortAnomal = this.createOutputPort();
/** The output port delivering the normal score if it exceeds or equals the threshold. */
private final OutputPort<StorableDetectionResult> outputPortNomal = this.createOutputPort();
private final double threshold;
public OutputPort<StorableDetectionResult> getOutputPortNormal() {
return outputPortNormal;
public OutputPort<StorableDetectionResult> getOutputPortAbnormal() {
return outputPortAnomal;
}
public OutputPort<StorableDetectionResult> getOutputPortAnnormal() {
return outputPortAnnormal;
public OutputPort<StorableDetectionResult> getOutputPortRegular() {
return outputPortNomal;
}
public double getThreshold() {
@@ -60,10 +60,14 @@ public class AnomalyDetectionFilter extends AbstractConsumerStage<StorableDetect
@Override
protected void execute(final StorableDetectionResult element) {
if (element.getValue() >= threshold) {
outputPortAnnormal.send(element);
this.outputPortAnomal.send(element);
} else {
outputPortNormal.send(element);
this.outputPortNomal.send(element);
}
}
}
Loading