[Buildbot-devel] Reporting Extra Information
Roy S. Rapoport
buildbot-devel at ols.inorganic.org
Tue Oct 3 17:34:24 UTC 2006
On Sat, Sep 30, 2006 at 03:14:02PM -0700, Brian Warner wrote:
> I'd patch buildbot/status/html.py, in StepBox.getBox(), which is where the
> text for the per-Step boxes is generated.
>
> def getBox(self):
> b = self.original.getBuild()
> ...
>
> That 'b' object provides all the methods described in
> buildbot.interfaces.IBuildStepStatus . (I would point at the epydoc-generated
> API reference page here, but it seems to be pretty empty.. I should figure
> out how to fix that). One of those methods is getTimes(), described here:
>
> def getTimes():
> """Returns a tuple of (start, end). 'start' and 'end' are the times
> (seconds since the epoch) when the Step started and finished. If the
> step has not yet started, 'start' will be None. If the step is still
> running, 'end' will be None."""
>
> So you could do something like:
>
> start, end = b.getTimes()
> if start and end: # only show time if the step has actually finished
> text += "%d secs" % (end - start)
Works great!
Only one problem: This gives me how long the _build_ took (note that it's a
'getBuild()' method above :) ), rather than how long each of the steps
took. Suggestions?
-roy
More information about the devel
mailing list