yahoo/sherlock

Abnormal percentage deviation

GPrabhudas opened this issue · 0 comments

FYI I'm referring to : https://github.com/yahoo/sherlock/blob/master/src/main/java/com/yahoo/sherlock/model/AnomalyReport.java#L272

int percentageDeviation = (int) (((interval.actualVal - interval.expectedVal) / interval.expectedVal) * 100);

Whenever the interval.expectedVal = 0.0f then, no matter what is the value of interval.actualVal we always get
percentageDeviation = 2147483647; // max value that can fit in int(32-bit signed integer)

Is it the expected behaviour or do we need to handle this case ?