From 55f6d26c9dda9f2e8194fc2500dd70c5d59fa30c Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Mon, 3 Jun 2013 09:44:43 -0400 Subject: bcfg2-lint: log run time for each lint plugin --- src/sbin/bcfg2-lint | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/sbin/bcfg2-lint') diff --git a/src/sbin/bcfg2-lint b/src/sbin/bcfg2-lint index 9a98eaaaa..9abec31a5 100755 --- a/src/sbin/bcfg2-lint +++ b/src/sbin/bcfg2-lint @@ -3,6 +3,7 @@ """This tool examines your Bcfg2 specifications for errors.""" import sys +import time import inspect import logging import Bcfg2.Logger @@ -52,7 +53,10 @@ def run_plugin(plugin, plugin_name, setup=None, errorhandler=None, args.append(setup) # python 2.5 doesn't support mixing *magic and keyword arguments - return plugin(*args, **dict(files=files, errorhandler=errorhandler)).Run() + start = time.time() + rv = plugin(*args, **dict(files=files, errorhandler=errorhandler)).Run() + LOGGER.debug(" Ran %s in %0.2f seconds" % (plugin_name, time.time() - start)) + return rv def get_errorhandler(setup): -- cgit v1.2.3-1-g7c22 From 3ed8637d59fcfe7b38aaa3f8717b0269d2c4650c Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Mon, 3 Jun 2013 13:16:21 -0400 Subject: fixed unit tests --- src/sbin/bcfg2-lint | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/sbin/bcfg2-lint') diff --git a/src/sbin/bcfg2-lint b/src/sbin/bcfg2-lint index 9abec31a5..ab3b6450f 100755 --- a/src/sbin/bcfg2-lint +++ b/src/sbin/bcfg2-lint @@ -55,7 +55,8 @@ def run_plugin(plugin, plugin_name, setup=None, errorhandler=None, # python 2.5 doesn't support mixing *magic and keyword arguments start = time.time() rv = plugin(*args, **dict(files=files, errorhandler=errorhandler)).Run() - LOGGER.debug(" Ran %s in %0.2f seconds" % (plugin_name, time.time() - start)) + LOGGER.debug(" Ran %s in %0.2f seconds" % (plugin_name, + time.time() - start)) return rv -- cgit v1.2.3-1-g7c22