parallel_emerge: provide more time logging
Example of new logging line:
Pending 0/1, Fetching 1/1, [Time 13:14:32 | Elapsed 0m4.5s | Load 0.8
1.09 1.1]
BUG=None
TEST=None
Change-Id: Ib0ed982087f3edeb5bc20ce5130814e590ad4923
Reviewed-on: https://chromium-review.googlesource.com/312296
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
diff --git a/scripts/parallel_emerge.py b/scripts/parallel_emerge.py
index 176ef34..c219965 100644
--- a/scripts/parallel_emerge.py
+++ b/scripts/parallel_emerge.py
@@ -1517,6 +1517,7 @@
def _Status(self):
"""Print status."""
current_time = time.time()
+ current_time_struct = time.localtime(current_time)
no_output = True
# Print interim output every minute if --show-output is used. Otherwise,
@@ -1563,7 +1564,9 @@
if retries:
line += "Retrying %s, " % (retries,)
load = " ".join(str(x) for x in os.getloadavg())
- line += ("[Time %dm%.1fs Load %s]" % (seconds / 60, seconds % 60, load))
+ line += ("[Time %s | Elapsed %dm%.1fs | Load %s]" % (
+ time.strftime('%H:%M:%S', current_time_struct), seconds / 60,
+ seconds % 60, load))
self._Print(line)
def _Finish(self, target):