add estimated completion time for build tasks to the taskinfo page
This commit is contained in:
parent
41580648e8
commit
ebd75bf0de
2 changed files with 19 additions and 2 deletions
|
|
@ -500,9 +500,18 @@ def taskinfo(req, taskID):
|
||||||
|
|
||||||
builds = server.listBuilds(taskID=task['id'])
|
builds = server.listBuilds(taskID=task['id'])
|
||||||
if builds:
|
if builds:
|
||||||
values['taskBuild'] = builds[0]
|
taskBuild = builds[0]
|
||||||
else:
|
else:
|
||||||
values['taskBuild'] = None
|
taskBuild = None
|
||||||
|
values['taskBuild'] = taskBuild
|
||||||
|
|
||||||
|
values['estCompletion'] = None
|
||||||
|
if taskBuild and taskBuild['state'] == koji.BUILD_STATES['BUILDING']:
|
||||||
|
avgDuration = server.getAverageBuildDuration(taskBuild['package_id'])
|
||||||
|
if avgDuration != None:
|
||||||
|
avgDelta = datetime.timedelta(seconds=avgDuration)
|
||||||
|
startTime = datetime.datetime.fromtimestamp(taskBuild['creation_ts'])
|
||||||
|
values['estCompletion'] = startTime + avgDelta
|
||||||
|
|
||||||
buildroots = server.listBuildroots(taskID=task['id'])
|
buildroots = server.listBuildroots(taskID=task['id'])
|
||||||
values['buildroots'] = buildroots
|
values['buildroots'] = buildroots
|
||||||
|
|
|
||||||
|
|
@ -199,9 +199,17 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th>Created</th><td>$util.formatTimeLong($task.create_time)</td>
|
<th>Created</th><td>$util.formatTimeLong($task.create_time)</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
#if $task.state == $koji.TASK_STATES.OPEN
|
||||||
|
#if $estCompletion
|
||||||
|
<tr>
|
||||||
|
<th>Est. Completion</th><td>$util.formatTimeLong($estCompletion)</td>
|
||||||
|
</tr>
|
||||||
|
#end if
|
||||||
|
#elif $task.completion_time
|
||||||
<tr>
|
<tr>
|
||||||
<th>Completed</th><td>$util.formatTimeLong($task.completion_time)</td>
|
<th>Completed</th><td>$util.formatTimeLong($task.completion_time)</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
#end if
|
||||||
<tr>
|
<tr>
|
||||||
<th>Owner</th>
|
<th>Owner</th>
|
||||||
<td>
|
<td>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue