Skip to content

Documentation

PhoronixSensorGraphs

This class allows you plot the sensor data recorded by Phoronix Test Suite (PTS) during a stress run. Requires Python >= 3.10.

Attributes:

Name Type Description
res_file str
res_path str
plt_layout str | tuple

res_path property writable

The path to the result directory.

Type: str

Default: "/home/<user_name>/.phoronix-test-suite/test-results/"

You can set a custom result directory using

psg.res_path = "/path/to/result/directory"

The result directory must have the following structure:

psg.res_path (i.e. the result directory)
 |
 +--- <Test_result_name>
       |
       +--- psg.res_file (i.e. the result file)

The program will throw an error if this directory structure is violated.

res_file property writable

The file name for the data file.

Type: str

Default: "composite.xml"

File type must be .xml.

You can set a custom file name for the data file using

psg.res_file = "custom_filename.xml"

plt_layout property writable

The layout of the subplots.

Type: str or tuple

Default: "auto"

Set a custom layout of the subplots using:

psg.plt_layout = (nrows, ncols)

where nrows is the number of rows, and ncols is the number of columns. Note that nrows*ncols MUST be >= no. of subplots expected. Without this, the program will throw an error. The default new_filename is "auto", which allows the program to automatically determine the best layout.

plot_sensor_data(res_name: str, sensors: tuple, cpu_usage_summary_only: bool = True, cpu_usage_separate_plots: bool = False)

Plots the sensor data recorded by Phoronix Test Suite.

Does NOT support the sensors cpu.freq, cpu.peak-freq and gpu.freq as of now. See this issue: https://github.com/phoronix-test-suite/phoronix-test-suite/issues/680

Parameters:

Name Type Description Default
res_name str

The test result name.

required
sensors tuple

The sensors to be potted; eg. ('cpu.temp', 'gpu.usage'). Note that some sensors, like cpu.usage, have entries for each core as well as a summary. By default, only the summary is plotted. To plot data for each and every core, see cpu_usage_summary_only and cpu_usage_separate_plots parameters.

required
cpu_usage_summary_only bool

Used only if sensors contains cpu.usage. If True, only the CPU Usage Summary data will be plotted, otherwise per-CPU usage data will also be plotted.

True
cpu_usage_separate_plots bool

Used only if cpu_usage_summary_only = True. If set to True, CPU Usage data for each CPU core/thread will be plotted in separate sub-plots.

False