From 6fe200903b31cb6abf6650bde18c44500787dae5 Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Mon, 4 Dec 2023 15:48:03 +0100 Subject: [PATCH] [foreman] Change scope of tasks history Collect up to 14 days of dynflow data instead of one month. Also, change granularity of the plugin option from months to days - we are almost never interested in tasks older than one month. Resolves: #3637 Signed-off-by: Pavel Moravec --- sos/report/plugins/foreman.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sos/report/plugins/foreman.py b/sos/report/plugins/foreman.py index d77baffb9b..d081bf89a2 100644 --- a/sos/report/plugins/foreman.py +++ b/sos/report/plugins/foreman.py @@ -25,8 +25,8 @@ class Foreman(Plugin): profiles = ('sysmgmt',) packages = ('foreman',) option_list = [ - PluginOpt('months', default=1, - desc='number of months for dynflow output'), + PluginOpt('days', default=14, + desc='number of days for dynflow output'), PluginOpt('proxyfeatures', default=False, desc='collect features of smart proxies'), PluginOpt('puma-gc', default=False, @@ -179,9 +179,9 @@ def setup(self): self.add_cmd_output(_cmd, suggest_filename='foreman_db_tables_sizes', env=self.env) - months = '%s months' % self.get_option('months') + days = '%s days' % self.get_option('days') - # Construct the DB queries, using the months option to limit the range + # Construct the DB queries, using the days option to limit the range # of entries returned scmd = ( @@ -198,7 +198,7 @@ def setup(self): 'select dynflow_execution_plans.* from foreman_tasks_tasks join ' 'dynflow_execution_plans on (foreman_tasks_tasks.external_id = ' 'dynflow_execution_plans.uuid::varchar) where foreman_tasks_tasks.' - 'started_at > NOW() - interval %s' % quote(months) + 'started_at > NOW() - interval %s' % quote(days) ) dactioncmd = ( @@ -206,7 +206,7 @@ def setup(self): 'dynflow_actions on (foreman_tasks_tasks.external_id = ' 'dynflow_actions.execution_plan_uuid::varchar) where ' 'foreman_tasks_tasks.started_at > NOW() - interval %s' - % quote(months) + % quote(days) ) dstepscmd = ( @@ -214,7 +214,7 @@ def setup(self): 'dynflow_steps on (foreman_tasks_tasks.external_id = ' 'dynflow_steps.execution_plan_uuid::varchar) where ' 'foreman_tasks_tasks.started_at > NOW() - interval %s' - % quote(months) + % quote(days) ) # counts of fact_names prefixes/types: much of one type suggests