Chromium Code Reviews| Index: appengine/findit/model/crash/fracas_crash_analysis.py |
| diff --git a/appengine/findit/model/crash/fracas_crash_analysis.py b/appengine/findit/model/crash/fracas_crash_analysis.py |
| index 8ace4ee376b5ed22bd71bdfa03b7be94b008fa54..cb254d80c20c908c60f9a4d9153c30ff286cc691 100644 |
| --- a/appengine/findit/model/crash/fracas_crash_analysis.py |
| +++ b/appengine/findit/model/crash/fracas_crash_analysis.py |
| @@ -11,33 +11,30 @@ from model.crash.crash_analysis import CrashAnalysis |
| class FracasCrashAnalysis(CrashAnalysis): |
| """Represents an analysis of a Chrome crash.""" |
| - # Data of crash per million page loads for each Chrome version. |
| - versions_to_cpm = ndb.JsonProperty(indexed=False) |
| + # Customized properties for Fracas crash. |
| + historic_metadata = ndb.JsonProperty(indexed=False) |
| + channel = ndb.StringProperty(indexed=False) |
| def Reset(self): |
| super(FracasCrashAnalysis, self).Reset() |
| - self.versions_to_cpm = None |
| - |
| - @ndb.ComputedProperty |
| - def channel(self): |
| - return self.key.pairs()[0][1].split('/')[0] |
| - |
| - @ndb.ComputedProperty |
| - def platform(self): |
| - return self.key.pairs()[0][1].split('/')[1] |
| + self.historic_metadata = None |
| + self.channel = None |
| @staticmethod |
| - def _CreateKey(channel, platform, signature): |
| + def _CreateKey(crash_identifiers): |
| # Use sha1 hex digest of signature to avoid char conflict with '/'. |
| - return ndb.Key('FracasCrashAnalysis', '%s/%s/%s' % ( |
| - channel, platform, hashlib.sha1(signature).hexdigest())) |
| + return ndb.Key('FracasCrashAnalysis', '%s/%s/%s/%s/%s' % ( |
| + crash_identifiers['channel'], crash_identifiers['platform'], |
|
stgao
2016/05/04 00:12:10
This solution is allergy to change of crash identi
Sharu Jiang
2016/05/04 00:57:17
Done.
|
| + hashlib.sha1(crash_identifiers['signature']).hexdigest(), |
| + crash_identifiers['chrome_version'], |
| + crash_identifiers[ |
| + 'process_type'] if crash_identifiers['process_type'] else '')) |
| @classmethod |
| - def Get(cls, channel, platform, signature): |
| - return cls._CreateKey(channel, platform, signature).get() |
| + def Get(cls, crash_identifiers): |
| + return cls._CreateKey(crash_identifiers).get() |
| @classmethod |
| - def Create(cls, channel, platform, signature): |
| - analysis = cls(key=cls._CreateKey(channel, platform, signature)) |
| - analysis.signature = signature |
| + def Create(cls, crash_identifiers): |
| + analysis = cls(key=cls._CreateKey(crash_identifiers)) |
| return analysis |