From 9ac99e085ae8b1bfd02937282897c06cd73d934f Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Mon, 7 Jul 2014 15:20:58 +0100 Subject: [plugin] add simple collect() profiling Similar to commit fd68a0c; add support for outputing messages indicating the time taken to call collect() for each plugin: [...] [plugin:systemtap] collected plugin 'systemtap' in 16.8759040833 [plugin:systemd] collected plugin 'systemd' in 19.5138418674 [plugin:block] collected plugin 'block' in 40.066119194 [plugin:yum] collected plugin 'yum' in 101.271748066 Signed-off-by: Bryn M. Reeves --- sos/plugins/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py index 4c34bda9..2730a990 100644 --- a/sos/plugins/__init__.py +++ b/sos/plugins/__init__.py @@ -624,9 +624,12 @@ class Plugin(object): def collect(self): """Collect the data for a plugin.""" + start = time() self.collect_copy_specs() self.collect_cmd_output() self.collect_strings() + fields = (self.name(), time() - start) + self.log_debug("collected plugin '%s' in %s" % fields) def get_description(self): """ This function will return the description for the plugin""" -- cgit