diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2014-07-07 15:20:58 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2014-07-07 15:20:58 +0100 |
commit | 9ac99e085ae8b1bfd02937282897c06cd73d934f (patch) | |
tree | 36faacd2d16256c4a65b4179e687a352186cb574 | |
parent | 4dbba1371ada73ccf0bd1c05ebb3d161d3bd7d08 (diff) | |
download | sos-9ac99e085ae8b1bfd02937282897c06cd73d934f.tar.gz |
[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 <bmr@redhat.com>
-rw-r--r-- | sos/plugins/__init__.py | 3 |
1 files changed, 3 insertions, 0 deletions
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""" |