Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: appengine/findit/model/base_analysis.py

Issue 2124973003: These are the database objects used while finding the regression range. 1/3 (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: removed unused code Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 # found in the LICENSE file.
4
5 from google.appengine.ext import ndb
6
7 from model import analysis_status
8
9
10 class BaseAnalysis(ndb.Model):
11 """Represents an analysis of a build of a builder in a Chromium waterfall.
lijeffrey 2016/07/19 22:32:21 nit: "... a build analysis of a ..." see if that g
caiw 2016/07/20 18:11:00 Done.
12 """
13
14 @property
15 def completed(self):
16 return self.status in (
17 analysis_status.COMPLETED, analysis_status.ERROR)
18
19 @property
20 def duration(self):
21 if not self.completed or not self.end_time or not self.start_time:
22 return None
23
24 return int((self.end_time - self.start_time).total_seconds())
25
26 @property
27 def failed(self):
28 return self.status == analysis_status.ERROR
29
30 @property
31 def status_description(self):
32 return analysis_status.STATUS_TO_DESCRIPTION.get(self.status, 'Unknown')
33
34 # The url path to the pipeline status page.
35 pipeline_status_path = ndb.StringProperty(indexed=False)
36
37 # The status of the analysis.
38 status = ndb.IntegerProperty(
39 default=analysis_status.PENDING, indexed=False)
40 # When the analysis was requested.
41 request_time = ndb.DateTimeProperty(indexed=False)
42 # When the analysis actually started.
43 start_time = ndb.DateTimeProperty(indexed=False)
44 # When the analysis actually ended.
45 end_time = ndb.DateTimeProperty(indexed=False)
46 # When the analysis was updated.
47 updated_time = ndb.DateTimeProperty(indexed=False, auto_now=True)
48 # Record which version of analysis.
49 version = ndb.StringProperty(indexed=False)
OLDNEW
« no previous file with comments | « no previous file | appengine/findit/model/base_swarming_task.py » ('j') | appengine/findit/model/base_swarming_task.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698