rayhunter.system_stats

class rayhunter.system_stats.BatteryState(is_plugged_in: bool, level: int)[source]

Bases: object

Device battery information.

is_plugged_in

A boolean indicating whether the battery is currently being charged.

Type:

bool

level

The current level in percentage of the device battery.

Type:

int

class rayhunter.system_stats.DiskStats(available_bytes: int | None, available_size: int, mounted_on: str, partition: str, total_size: int, used_percent: int, used_size: int)[source]

Bases: object

Disk usage statistics and information about the underlying filesystem, obtained from the Rayhunter API.

Size and percentage values are converted from string (e.g. 214.7M) to bytes (e.g. 225129267) for programmatic ease of use.

available_bytes

The amount of disk space currently available in bytes.

Type:

Optional[int]

available_size

The amount of disk space currently available in bytes (e.g. 206884044).

Type:

int

mounted_on

The root folder to which the partition is mounted.

Type:

str

partition

The partition Rayhunter is mounted on (e.g. ubi0:usrfs).

Type:

str

total_size

Total size of the disk in bytes (e.g. 225129267).

Type:

int

used_percent

The percentage of disk space currently in use (e.g. 8).

Type:

int

used_size

The amount of disk space currently in use in bytes (e.g. 18350080).

Type:

int

class rayhunter.system_stats.MemoryStats(total: int, used: int, free: int)[source]

Bases: object

Memory usage statistics, obtained from the Rayhunter API.

Size and percentage values are converted from string (e.g. 159.9) to bytes (e.g. 167667302) for programmatic ease of use.

total

Total size of memory in bytes (e.g. 167667302).

Type:

int

used

The amount of memory currently in use in bytes (e.g. 149212364).

Type:

int

free

The amount of memory currently available in bytes (e.g. 18454937)

Type:

int

class rayhunter.system_stats.RuntimeMetadata(arch: str, rayhunter_version: str, system_os: str)[source]

Bases: object

Expose binary and system information.

arch

The CPU architecture in use. e.g., “armv7l” or “arm”.

Type:

str

rayhunter_version

The cargo package version from this library’s cargo.toml, e.g., “1.2.3”.

Type:

str

system_os

The operating system sysname and optionally release. e.g., “Linux 3.18.48” or “linux”.

Type:

str

class rayhunter.system_stats.SystemStats(battery_status: BatteryState | None, disk_stats: DiskStats, memory_stats: MemoryStats, runtime_metadata: RuntimeMetadata)[source]

Bases: object

Disk and memory utilization statistics for the underlying system, pulled from the Rayhunter API.

battery_status

Optionally included power information

Type:

Optional[BatteryState]

disk_stats

Information on the underlying disk

Type:

DiskStats

memory_stats

Information on system memory utilization

Type:

MemoryStats

runtime_metadata

System and binary information

Type:

RuntimeMetadata