Skip to content

Commit

Permalink
[report] Collect times about plugins postprocessing
Browse files Browse the repository at this point in the history
Likewise we collect plugin setup and execution times, let collect plugin
postproc times. Note that postprocessing is done after all plugins are
collected and its time is not covered in either current manifest data.

Resolves: #3834

Signed-off-by: Pavel Moravec <[email protected]>
  • Loading branch information
pmoravec committed Nov 13, 2024
1 parent ba6c200 commit 32af5d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sos/report/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,12 @@ def postproc(self):
for plugname, plug in self.loaded_plugins:
try:
if plug.get_option('postproc'):
start = datetime.now()
plug.manifest.add_field('postproc_start', start)
plug.postproc()
end = datetime.now()
plug.manifest.add_field('postproc_end', end)
plug.manifest.add_field('postproc_time', end - start)
else:
self.soslog.info(
f"Skipping postproc for plugin {plugname}")
Expand Down
3 changes: 3 additions & 0 deletions sos/report/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,9 @@ def set_plugin_manifest(self, manifest):
self.manifest.add_field('setup_start', '')
self.manifest.add_field('setup_end', '')
self.manifest.add_field('setup_time', '')
self.manifest.add_field('postproc_start', '')
self.manifest.add_field('postproc_end', '')
self.manifest.add_field('postproc_time', '')
self.manifest.add_field('timeout', self.timeout)
self.manifest.add_field('timeout_hit', False)
self.manifest.add_field('command_timeout', self.cmdtimeout)
Expand Down

0 comments on commit 32af5d5

Please sign in to comment.