RSGISLib System Profiling Tools
- rsgislib.tools.sysprofile.create_mem_cpu_profile(out_file, interval=3, duration=600)
A function which creates a profile of memory and cpu usage of the system.
This function provides information for the whole system not a single process. Therefore, if you are trying to study the performance of a single function you should minimise the use of the system for anything other than the experiment you are performing in-order to avoid misleading results.
It is recommended that you run the function for a period (e.g., 30 seconds) before starting your processing so the background system usage can be estimated when the results are analysed.
- Parameters:
out_file – The output file to which the information will be saved.
interval – The interval, in seconds, at which the information should be recorded. (default: 3 seconds)
duration – The time, in seconds, for which the function should run for. (default: 600 seconds; 10 mins)
- rsgislib.tools.sysprofile.plot_mem_cpu_profile(profile_file, out_plot_file='sys_profile.pdf', ref_period=30, interval=3, plot_format='PDF')
A function which creates a plot using the output of the rsgislib.tools.create_mem_cpu_profile function. A reference period can be used to estimate the background system usage which is removed from the whole timeseries.
- Parameters:
profile_file – a csv file from the rsgislib.tools.create_mem_cpu_profile function.
out_plot_file – the output image file. Default: sys_profile.pdf
ref_period – a reference period (in seconds) from which the background system resources will be estimated and removed from the whole timeseries. Default: 30 seconds. If a value of 0 is provided (or less 4 x interval) then no reference period will be used.
interval – the interval (in seconds) between measurements; used within the create_mem_cpu_profile function.
plot_format – the file format for the outputted plot (i.e., PDF or PNG). Default: PDF