smah.settings.system.stats

class smah.settings.system.stats.BaseStats[source]

Bases: object

stale(threshold=100)[source]

Checks if the disk statistics are stale based on the given threshold.

Parameters:

threshold (int) – The threshold in microseconds.

Returns:

True if the statistics are stale, False otherwise.

Return type:

bool

class smah.settings.system.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.

class smah.settings.system.stats.DiskStats[source]

Bases: BaseStats

Represents disk statistics.

time_stamp

The timestamp of the last update.

Type:

datetime

total

The last recorded total disk space.

Type:

float

available

The last recorded available disk space.

Type:

float

used

The last recorded used disk space.

Type:

float

percent

The last recorded disk usage percentage.

Type:

float

static disk_info(reading)[source]

Retrieves disk information based on the specified reading type.

Parameters:

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

Returns:

The requested disk information.

Return type:

float

readings(threshold=100)[source]

Retrieves the current disk readings, updating if necessary.

Parameters:

threshold (int) – The threshold in microseconds.

Returns:

The current disk readings.

Return type:

dict

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

Updates the disk statistics.

class smah.settings.system.stats.MemoryStats[source]

Bases: BaseStats

Represents memory statistics.

time_stamp

The timestamp of the last update.

Type:

datetime

total

The last recorded total memory.

Type:

float

available

The last recorded available memory.

Type:

float

used

The last recorded used memory.

Type:

float

percent

The last recorded memory usage percentage.

Type:

float

static memory_info(reading)[source]

Retrieves memory information based on the specified reading type.

Parameters:

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

Returns:

The requested memory information.

Return type:

float

readings(threshold=100)[source]

Retrieves the current memory readings, updating if necessary.

Parameters:

threshold (int) – The threshold in microseconds.

Returns:

The current memory readings.

Return type:

dict

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

Updates the memory statistics.

Modules

base_stats

cpu_stats

disk_stats

memory_stats