| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from google.appengine.ext import ndb | 5 from google.appengine.ext import ndb |
| 6 | 6 |
| 7 from model import analysis_status | 7 from model import analysis_status |
| 8 | 8 |
| 9 | 9 |
| 10 class CrashAnalysis(ndb.Model): | 10 class CrashAnalysis(ndb.Model): |
| 11 """Base class to represent an analysis of a Chrome crash.""" | 11 """Base class to represent an analysis of a Chrome/Clusterfuzz crash.""" |
| 12 ################### Properties for the crash itself. ################### | 12 ################### Properties for the crash itself. ################### |
| 13 # In which version or revision of Chrome the crash occurred. Either a version | 13 # In which version or revision of Chrome the crash occurred. Either a version |
| 14 # number for Chrome build or a git commit hash/position for chromium build. | 14 # number for Chrome build or a git commit hash/position for chromium build. |
| 15 crashed_version = ndb.StringProperty(indexed=False) | 15 crashed_version = ndb.StringProperty(indexed=False) |
| 16 | 16 |
| 17 # The stack_trace_string. | 17 # The stack_trace_string. |
| 18 stack_trace = ndb.StringProperty(indexed=False) | 18 stack_trace = ndb.StringProperty(indexed=False) |
| 19 | 19 |
| 20 # The signature of the crash. | 20 # The signature of the crash. |
| 21 signature = ndb.StringProperty(indexed=False) | 21 signature = ndb.StringProperty(indexed=False) |
| 22 | 22 |
| 23 # The platform of this crash. |
| 24 platform = ndb.StringProperty(indexed=False) |
| 25 |
| 26 # ID to differentiate different client. |
| 27 client_id = ndb.StringProperty(indexed=False) |
| 28 |
| 23 ################### Properties for the analysis progress. ################### | 29 ################### Properties for the analysis progress. ################### |
| 24 | 30 |
| 25 # The url path to the pipeline status page. | 31 # The url path to the pipeline status page. |
| 26 pipeline_status_path = ndb.StringProperty(indexed=False) | 32 pipeline_status_path = ndb.StringProperty(indexed=False) |
| 27 | 33 |
| 28 # The status of the analysis. | 34 # The status of the analysis. |
| 29 status = ndb.IntegerProperty( | 35 status = ndb.IntegerProperty( |
| 30 default=analysis_status.PENDING, indexed=False) | 36 default=analysis_status.PENDING, indexed=False) |
| 31 | 37 |
| 32 # When the analysis was requested. | 38 # When the analysis was requested. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 @property | 76 @property |
| 71 def failed(self): | 77 def failed(self): |
| 72 return self.status == analysis_status.ERROR | 78 return self.status == analysis_status.ERROR |
| 73 | 79 |
| 74 @property | 80 @property |
| 75 def duration(self): | 81 def duration(self): |
| 76 if not self.completed: | 82 if not self.completed: |
| 77 return None | 83 return None |
| 78 | 84 |
| 79 return int((self.completed_time - self.started_time).total_seconds()) | 85 return int((self.completed_time - self.started_time).total_seconds()) |
| OLD | NEW |