From: Michael Tremer Date: Tue, 23 Mar 2010 13:49:58 +0000 (+0100) Subject: naoki: Capture time that a build takes. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d0455c301739575164daddbefd7d6c77b47fa25;p=ipfire-3.x.git naoki: Capture time that a build takes. --- diff --git a/naoki/chroot.py b/naoki/chroot.py index 73c29dacd..e6b5fdc58 100644 --- a/naoki/chroot.py +++ b/naoki/chroot.py @@ -5,6 +5,7 @@ import logging import os import random import stat +import time import backend import util @@ -258,12 +259,18 @@ class Environment(object): def build(self): self.package.download() + # Save start time + time_start = time.time() + try: self.make("package") except Error: if config["cleanup_on_failure"]: self.clean() raise + finally: + time_end = time.time() + self.log.debug("Package build took %.2fs" % (time_end - time_start)) if config["cleanup_on_success"]: self.clean()