[oe-commits] [bitbake] 05/05: knotty: Pretty print task elapsed time
git at git.openembedded.org
git at git.openembedded.org
Mon Apr 29 13:17:32 UTC 2019
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository bitbake.
commit 931fce58a3ff24bbc52931085ea5350b79f6d820
Author: Jacob Kroon <jacob.kroon at gmail.com>
AuthorDate: Fri Apr 26 23:37:27 2019 +0200
knotty: Pretty print task elapsed time
A task's runtime is currently printed in seconds. Change it to
include minutes and hours for easier reading.
Signed-off-by: Jacob Kroon <jacob.kroon at gmail.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/ui/knotty.py | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py
index 6516f30..798ccec 100644
--- a/lib/bb/ui/knotty.py
+++ b/lib/bb/ui/knotty.py
@@ -227,6 +227,18 @@ class TerminalFilter(object):
print("Bitbake still alive (%ds)" % t)
sys.stdout.flush()
+ def elapsed(self, sec):
+ hrs = int(sec / 3600.0)
+ sec -= hrs * 3600
+ min = int(sec / 60.0)
+ sec -= min * 60
+ if hrs > 0:
+ return "%dh%dm%ds" % (hrs, min, sec)
+ elif min > 0:
+ return "%dm%ds" % (min, sec)
+ else:
+ return "%ds" % (sec)
+
def updateFooter(self):
if not self.cuu:
return
@@ -263,7 +275,7 @@ class TerminalFilter(object):
else:
start_time = activetasks[t].get("starttime", None)
if start_time:
- tasks.append("%s - %ds (pid %s)" % (activetasks[t]["title"], currenttime - start_time, t))
+ tasks.append("%s - %s (pid %s)" % (activetasks[t]["title"], self.elapsed(currenttime - start_time), t))
else:
tasks.append("%s (pid %s)" % (activetasks[t]["title"], t))
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list