| Index: dashboard/dashboard/models/anomaly.py
|
| diff --git a/dashboard/dashboard/models/anomaly.py b/dashboard/dashboard/models/anomaly.py
|
| index 9334f786ba721256d742a19bf6129d39b6595218..bc3e296855b78c2e0f19bff0f4d18eec85389c75 100644
|
| --- a/dashboard/dashboard/models/anomaly.py
|
| +++ b/dashboard/dashboard/models/anomaly.py
|
| @@ -67,6 +67,11 @@ class Anomaly(alert.Alert):
|
| return 100 * difference / self.median_before_anomaly
|
|
|
| @property
|
| + def absolute_delta(self):
|
| + """The absolute change from before the anomaly to after."""
|
| + return self.median_after_anomaly - self.median_before_anomaly
|
| +
|
| + @property
|
| def direction(self):
|
| """Whether the change is numerically an increase or decrease."""
|
| if self.median_before_anomaly < self.median_after_anomaly:
|
| @@ -78,7 +83,14 @@ class Anomaly(alert.Alert):
|
| if abs(self.percent_changed) == sys.float_info.max:
|
| return FREAKIN_HUGE
|
| else:
|
| - return str('%.1f%%' % abs(self.percent_changed))
|
| + return '%.1f%%' % abs(self.percent_changed)
|
| +
|
| + def GetDisplayAbsoluteChanged(self):
|
| + """Gets a string showing the absolute change."""
|
| + if abs(self.absolute_delta) == sys.float_info.max:
|
| + return FREAKIN_HUGE
|
| + else:
|
| + return '%f' % abs(self.absolute_delta)
|
|
|
| def SetIsImprovement(self, test=None):
|
| """Sets whether the alert is an improvement for the given test."""
|
|
|