summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sherwood <paul.sherwood@codethink.co.uk>2014-09-27 18:38:55 +0000
committerPaul Sherwood <paul.sherwood@codethink.co.uk>2014-09-27 18:38:55 +0000
commit1779a3a3ecb9be5618dce8d76a0edb6eec4b70d7 (patch)
tree361473d33b9a231d1f8d94864dbe0bd31ddca017
parentc754d0366d4557910775bfa83c85ffdf98af0610 (diff)
downloadmorph-1779a3a3ecb9be5618dce8d76a0edb6eec4b70d7.tar.gz
Log elapsed time for each chunk buildbaserock/ps/log-chunk-build-times
-rw-r--r--morphlib/buildcommand.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py
index edd2f0c5..c5ba05e5 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
@@ -320,6 +321,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'])
@@ -367,6 +369,11 @@ class BuildCommand(object):
self.build_and_cache(staging_area, source, setup_mounts)
self.remove_staging_area(staging_area)
+ td = datetime.datetime.now() - starttime
+ td_string = "%02d:%02d:%02d" % (td.seconds/3600,
+ td.seconds%3600/60, td.seconds%60)
+ self.app.status(msg="Elapsed time %(duration)s", duration=td_string)
+
def get_recursive_deps(self, artifacts):
deps = set()
ordered_deps = []