foreman_maintain
foreman_maintain copied to clipboard
Add timing to each step
I think there is value in having this information always to help any reports identify what might be running slowly. I was thinking about this with regard to https://github.com/theforeman/foreman_maintain/pull/719 where it could help us identify places where we could optimize the runtime and reduce downtime.
Example output:
Running preparation steps required to run the next scenarios
================================================================================
Check whether system has any non Red Hat repositories (e.g.: EPEL) enabled:
| Checking repositories enabled on the system [OK] [6.02]
--------------------------------------------------------------------------------
Running Checks before upgrading to Satellite 6.13.z
================================================================================
Clean old Kernel and initramfs files from tftp-boot: [OK] [2.71]
--------------------------------------------------------------------------------
Check number of fact names in database: [OK] [0.06]
--------------------------------------------------------------------------------
Check whether all services are running: [OK] [0.52]
--------------------------------------------------------------------------------
Check whether all services are running using the ping call: [OK] [0.2]
--------------------------------------------------------------------------------
Check for paused tasks: [OK] [0.03]
--------------------------------------------------------------------------------
Check whether system is self-registered or not: [OK] [0.0]
--------------------------------------------------------------------------------
Check to make sure root(/) partition has enough space: [OK] [0.0]
--------------------------------------------------------------------------------
Check to make sure /var/lib/candlepin has enough space: [OK] [0.0]
--------------------------------------------------------------------------------
I like the idea. Is this something that you could pass as an option to show the time output? Or do you want this to be default? My main suggestion would be to put the unit of measurement like s
for seconds or you could even do the math and put ms
if you wanted to. I also think parenthesis might look better but that's not a big deal.
Running preparation steps required to run the next scenarios
================================================================================
Check whether system has any non Red Hat repositories (e.g.: EPEL) enabled:
| Checking repositories enabled on the system [OK] (6.02 s)
--------------------------------------------------------------------------------
Running Checks before upgrading to Satellite 6.13.z
================================================================================
Clean old Kernel and initramfs files from tftp-boot: [OK] (2.71 s)
--------------------------------------------------------------------------------
Check number of fact names in database: [OK] (60 ms)
--------------------------------------------------------------------------------
Check whether all services are running: [OK] (520 ms)
--------------------------------------------------------------------------------
Check whether all services are running using the ping call: [OK] (200 ms)
--------------------------------------------------------------------------------
Check for paused tasks: [OK] (300 ms)
--------------------------------------------------------------------------------
Check whether system is self-registered or not: [OK] (0 ms)
--------------------------------------------------------------------------------
Check to make sure root(/) partition has enough space: [OK] (0 ms)
--------------------------------------------------------------------------------
Check to make sure /var/lib/candlepin has enough space: [OK] (0 ms)
--------------------------------------------------------------------------------
What about omitting times below some threshold , like below 5 sec ? Not interested in timing of quick actions
Currently contains https://github.com/theforeman/foreman_maintain/pull/793 to get a single Packit build with both for further data gathering.