summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2014-10-09 12:29:35 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2014-10-09 12:29:35 +0000
commit120b16734079e5899b04f76a8c3c37c9a3ae8b3a (patch)
tree8685fa13968fcf992ba098cc386d66651dc32d3f
parent5c395fa2eef5db538c266085dd8f970a3883dd7c (diff)
parent1779a3a3ecb9be5618dce8d76a0edb6eec4b70d7 (diff)
downloadmorph-120b16734079e5899b04f76a8c3c37c9a3ae8b3a.tar.gz
Merge remote-tracking branch 'origin/baserock/ps/log-chunk-build-times'
Reviewed-by: Pedro Alvarez Reviewed-by: Richard Maw
-rw-r--r--morphlib/buildcommand.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py
index c58466c2..2aec5e08 100644
--- a/morphlib/buildcommand.py
+++ b/morphlib/buildcommand.py
@@ -19,6 +19,7 @@ import os
import shutil
import logging
import tempfile
+import datetime
import morphlib
import distbuild
@@ -306,6 +307,7 @@ class BuildCommand(object):
in either the local or remote cache already.
'''
+ starttime = datetime.datetime.now()
self.app.status(msg='Building %(kind)s %(name)s',
name=source.name,
kind=source.morphology['kind'])
@@ -353,6 +355,12 @@ class BuildCommand(object):
self.build_and_cache(staging_area, source, setup_mounts)
self.remove_staging_area(staging_area)
+ td = datetime.datetime.now() - starttime
+ hours, remainder = divmod(int(td.total_seconds()), 60*60)
+ minutes, seconds = divmod(remainder, 60)
+ td_string = "%02d:%02d:%02d" % (hours, minutes, seconds)
+ self.app.status(msg="Elapsed time %(duration)s", duration=td_string)
+
def get_recursive_deps(self, artifacts):
deps = set()
ordered_deps = []