Skip to content
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...
1 parent e17bc42 commit c5228020a5db07b2a907bb9925c2c5da38ae0ea8 @cboos committed Apr 27, 2010
Showing with 10 additions and 5 deletions.
  1. +10 −5 HudsonTrac/HudsonTracPlugin.py
View
15 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
@cboos
Owner
cboos added a note Apr 27, 2010

s/ignore/eventually ignore/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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':
@cboos
Owner
cboos added a note Apr 27, 2010

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ # 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
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.
Something went wrong with that request. Please try again.