smah.settings.system.stats.cpu_stats

Classes

CpuStats()

Represents CPU statistics.

class smah.settings.system.stats.cpu_stats.CpuStats[source]

Bases: BaseStats

Represents CPU statistics.

time_stamp

The timestamp of the last update.

Type:

datetime

cpu_count

The last recorded CPU count.

Type:

int

cpu_freq

The last recorded CPU frequency.

Type:

float

cpu_percent

The last recorded CPU usage percentage.

Type:

float

static cpu_info(reading)[source]

Retrieves CPU information based on the specified reading type.

Parameters:

reading (str) – The type of CPU information to retrieve.

Returns:

The requested CPU information.

Return type:

int or float

readings(threshold=100)[source]

Retrieves the current CPU readings, updating if necessary.

Parameters:

threshold (int) – The threshold in microseconds.

Returns:

The current CPU readings.

Return type:

dict

show(options=None)[source]
update()[source]

Updates the CPU statistics.