| Index: dashboard/dashboard/models/anomaly.py
|
| diff --git a/dashboard/dashboard/models/anomaly.py b/dashboard/dashboard/models/anomaly.py
|
| index bc3e296855b78c2e0f19bff0f4d18eec85389c75..f1323398922fc9246533f4d11d47c3de048d88bc 100644
|
| --- a/dashboard/dashboard/models/anomaly.py
|
| +++ b/dashboard/dashboard/models/anomaly.py
|
| @@ -8,6 +8,7 @@ import sys
|
|
|
| from google.appengine.ext import ndb
|
|
|
| +from dashboard.common import utils
|
| from dashboard.models import alert
|
|
|
| # A string to describe the magnitude of a change from zero to non-zero.
|
| @@ -55,6 +56,9 @@ class Anomaly(alert.Alert):
|
| # is a corresponding step up later on, or vice versa.)
|
| recovered = ndb.BooleanProperty(indexed=True, default=False)
|
|
|
| + # If the TestMetadata alerted upon has a ref build, store the ref build.
|
| + ref_test = ndb.KeyProperty(indexed=False)
|
| +
|
| # The corresponding units from the TestMetaData entity.
|
| units = ndb.StringProperty(indexed=False)
|
|
|
| @@ -92,6 +96,11 @@ class Anomaly(alert.Alert):
|
| else:
|
| return '%f' % abs(self.absolute_delta)
|
|
|
| + def GetRefTestPath(self):
|
| + if not self.ref_test:
|
| + return None
|
| + return utils.TestPath(self.ref_test)
|
| +
|
| def SetIsImprovement(self, test=None):
|
| """Sets whether the alert is an improvement for the given test."""
|
| if not test:
|
|
|