Skip to content

Commit ae6b8f9

Browse files
authored
Merge pull request #724 from xcp-ng/gln/pkg-in-pipe-kquq
2 parents 826bfc4 + 1af4291 commit ae6b8f9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

scripts/pkg_in_pipe/pkg_in_pipe.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,12 @@ def print_generic_error(out):
7878
</div>
7979
</div>'''), file=out)
8080

81-
def print_footer(out, generated_info):
81+
def print_footer(out, started_at, generated_info):
8282
now = datetime.now()
83+
duration = now - started_at
8384
print(dedent(f'''
84-
Last generated at {now}. {generated_info or ''}
85+
Generated on {now.date()} at {now.time().strftime("%H:%M:%S")} (took {duration.seconds} seconds).
86+
{generated_info or ''}
8587
</body>
8688
</html>
8789
'''), file=out)
@@ -253,6 +255,9 @@ def find_pull_requests(gh, repo, start_sha, end_sha):
253255
prs.update(commit_prs)
254256
return sorted(prs, key=lambda p: p.number, reverse=True)
255257

258+
259+
started_at = datetime.now()
260+
256261
parser = argparse.ArgumentParser(description='Generate a report of the packages in the pipe')
257262
parser.add_argument('output', nargs='?', help='Report output path', default='report.html')
258263
parser.add_argument('--generated-info', help="Add this message about the generation in the report")
@@ -331,7 +336,7 @@ def find_pull_requests(gh, repo, start_sha, end_sha):
331336
print_generic_error(out)
332337
raise
333338
finally:
334-
print_footer(out, args.generated_info)
339+
print_footer(out, started_at, args.generated_info)
335340

336341
# write the actual output at once, in order to avoid a blank page during the processing
337342
with open(args.output, 'w') as f:

0 commit comments

Comments
 (0)