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

Side by Side Diff: buildbot/status/web/build.py

Issue 20095: Add the time it takes to run a step in the build (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/tools/buildbot/pylibs/
Patch Set: Created 11 years, 10 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
« no previous file with comments | « buildbot/README.google ('k') | buildbot/status/web/build_orig.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 from twisted.web import html 2 from twisted.web import html
3 from twisted.web.util import Redirect, DeferredResource 3 from twisted.web.util import Redirect, DeferredResource
4 from twisted.internet import defer, reactor 4 from twisted.internet import defer, reactor
5 5
6 import urllib, time 6 import urllib, time
7 from twisted.python import log 7 from twisted.python import log
8 from buildbot.status.web.base import HtmlResource, make_row, make_stop_form, \ 8 from buildbot.status.web.base import HtmlResource, make_row, make_stop_form, \
9 css_classes, path_to_builder 9 css_classes, path_to_builder
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 # TODO: 97 # TODO:
98 # urls = self.original.getURLs() 98 # urls = self.original.getURLs()
99 # ex_url_class = "BuildStep external" 99 # ex_url_class = "BuildStep external"
100 # for name, target in urls.items(): 100 # for name, target in urls.items():
101 # text.append('[<a href="%s" class="%s">%s</a>]' % 101 # text.append('[<a href="%s" class="%s">%s</a>]' %
102 # (target, ex_url_class, html.escape(name))) 102 # (target, ex_url_class, html.escape(name)))
103 if b.getLogs(): 103 if b.getLogs():
104 data += "<ol>\n" 104 data += "<ol>\n"
105 for s in b.getSteps(): 105 for s in b.getSteps():
106 name = s.getName() 106 name = s.getName()
107 data += (" <li><a href=\"%s\">%s</a> [%s]\n" 107 time_to_run = 0
108 (start, end) = s.getTimes()
109 if start and end:
110 time_to_run = end - start
111 data += (" <li><a href=\"%s\">%s</a> [%s] [%d seconds]\n"
108 % (req.childLink("steps/%s" % urllib.quote(name)), 112 % (req.childLink("steps/%s" % urllib.quote(name)),
109 name, 113 name,
110 " ".join(s.getText()))) 114 " ".join(s.getText()),
115 time_to_run))
111 if s.getLogs(): 116 if s.getLogs():
112 data += " <ol>\n" 117 data += " <ol>\n"
113 for logfile in s.getLogs(): 118 for logfile in s.getLogs():
114 logname = logfile.getName() 119 logname = logfile.getName()
115 logurl = req.childLink("steps/%s/logs/%s" % 120 logurl = req.childLink("steps/%s/logs/%s" %
116 (urllib.quote(name), 121 (urllib.quote(name),
117 urllib.quote(logname))) 122 urllib.quote(logname)))
118 data += (" <li><a href=\"%s\">%s</a></li>\n" % 123 data += (" <li><a href=\"%s\">%s</a></li>\n" %
119 (logurl, logfile.getName())) 124 (logurl, logfile.getName()))
120 data += " </ol>\n" 125 data += " </ol>\n"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 if build_status: 285 if build_status:
281 if self.builder_control: 286 if self.builder_control:
282 build_control = self.builder_control.getBuild(num) 287 build_control = self.builder_control.getBuild(num)
283 else: 288 else:
284 build_control = None 289 build_control = None
285 return StatusResourceBuild(build_status, build_control, 290 return StatusResourceBuild(build_status, build_control,
286 self.builder_control) 291 self.builder_control)
287 292
288 return HtmlResource.getChild(self, path, req) 293 return HtmlResource.getChild(self, path, req)
289 294
OLDNEW
« no previous file with comments | « buildbot/README.google ('k') | buildbot/status/web/build_orig.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698