Permalink
Browse files

For in-progress builds, estimate the duration

We do this by taking the current time of the Trac host for the
intermediate "completed" timestamp, which is OK as far as the
Trac host and the Hudson host clocks are synchronized.
  • Loading branch information...
cboos committed Apr 27, 2010
1 parent e17bc42 commit c5228020a5db07b2a907bb9925c2c5da38ae0ea8
Showing with 10 additions and 5 deletions.
  1. +10 −5 HudsonTrac/HudsonTracPlugin.py
@@ -186,18 +186,23 @@ def get_number(parent, child):
for entry in info.documentElement.getElementsByTagName("build"):
# ignore builds that are still running

This comment has been minimized.

Show comment
Hide comment
@cboos

cboos Apr 27, 2010

Owner

s/ignore/eventually ignore/

@cboos

cboos Apr 27, 2010

Owner

s/ignore/eventually ignore/

if get_string(entry, 'building') == 'true':
- if not self.display_building:
- continue
- else:
+ if self.display_building:
result = 'INPROGRESS'
+ else:
+ continue
else:
result = get_string(entry, 'result')
# create timeline entry
started = get_number(entry, 'timestamp')
- completed = started + get_number(entry, 'duration')
+ if result == 'INPROGRESS':

This comment has been minimized.

Show comment
Hide comment
@cboos

cboos Apr 27, 2010

Owner

maybe have an option to turn this off, in case clocks are really not the same?

@cboos

cboos Apr 27, 2010

Owner

maybe have an option to turn this off, in case clocks are really not the same?

+ # we hope the clocks are close...
+ completed = time.time()
+ else:
+ duration = get_number(entry, 'duration')
+ completed = started + duration
+ completed /= 1000
started /= 1000
- completed /= 1000
message, kind = {
'SUCCESS': ('Build finished successfully',

1 comment on commit c522802

@cboos

This comment has been minimized.

Show comment
Hide comment
@cboos

cboos Apr 27, 2010

Owner

note that these are just random comments to try out how #2035 works here...

Owner

cboos commented on c522802 Apr 27, 2010

note that these are just random comments to try out how #2035 works here...

Please sign in to comment.