[diffoscope] 03/05: Profile external commands by wrapping "@tool_required".

Chris Lamb chris at chris-lamb.co.uk
Fri Dec 23 12:46:37 CET 2016


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository diffoscope.

commit 0c3c88fc930f3755e6f4fb0879783e2585863e85
Author: Chris Lamb <lamby at debian.org>
Date:   Fri Dec 23 11:43:01 2016 +0000

    Profile external commands by wrapping "@tool_required".
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 diffoscope/__init__.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/diffoscope/__init__.py b/diffoscope/__init__.py
index 7408c7e..4cf4dbf 100644
--- a/diffoscope/__init__.py
+++ b/diffoscope/__init__.py
@@ -27,6 +27,8 @@ import time
 
 from distutils.spawn import find_executable
 
+from diffoscope.profiling import profile
+
 VERSION = "64"
 
 logger = logging.getLogger("diffoscope")
@@ -68,7 +70,8 @@ def tool_required(command):
         if find_executable(command):
             @functools.wraps(original_function)
             def tool_check(*args, **kwargs):
-                return original_function(*args, **kwargs)
+                with profile('command', command):
+                    return original_function(*args, **kwargs)
         else:
             @functools.wraps(original_function)
             def tool_check(*args, **kwargs):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list