From 1779a3a3ecb9be5618dce8d76a0edb6eec4b70d7 Mon Sep 17 00:00:00 2001 From: Paul Sherwood Date: Sat, 27 Sep 2014 18:38:55 +0000 Subject: Log elapsed time for each chunk build --- morphlib/buildcommand.py | 7 +++++++ 1 file changed, 7 insertions(+) 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 = [] -- cgit v1.2.1