Skip to main content

hardware

TOC

Attributes

🅰 hardware

hardware = Hardware() #watch updates in daemon

Functions

🅵 return_default_config

@export_default_config
def return_default_config() -> dict:

🅵 load_monit_hardware

@on_workspace_loaded(name="hardware-monit")
def load_monit_hardware():

Classes

🅲 CpuStatus

class CpuStatus:

🅼 __init__

def __init__(self, id=-1, percentage=0.0, frequency=0.0):

🅼 __str__

def __str__(self) -> str:

🅼 json

@property
def json(self):

🅲 CpuStatistics

class CpuStatistics:

🅼 __init__

def __init__(self, ctx_switches, interrupts, soft_interrupts, syscalls) -> None:

🅼 json

@property
def json(self):

🅼 __str__

def __str__(self) -> str:

🅲 MemoryStatus

class MemoryStatus:

🅼 __init__

def __init__(self, total, available, used, free) -> None:

🅼 json

@property
def json(self):

🅼 __str__

def __str__(self) -> str:

🅲 NvGpuStatus

class NvGpuStatus(GPU):

🅼 parse

@classmethod
def parse(cls, other: GPU):

🅼 json

@property
def json(self):

🅼 __str__

def __str__(self) -> str:

🅲 Hardware

class Hardware:
watch_thread: Thread = None
_do_watch: bool = True
_update_interval: float = 1.0
_cpus: List[CpuStatus] = None
_gpus: List[NvGpuStatus] = None
_cpu_statistics: CpuStatistics = None
_memory: MemoryStatus = None
_on_update_call_backs = []

🅼 __init__

def __init__(self) -> None:

🅼 cpus

@property
def cpus(self):

🅼 cpu_statistics

@property
def cpu_statistics(self):

🅼 memory

@property
def memory(self):

🅼 gpus

@property
def gpus(self):

🅼 with_gpu

@property
def with_gpu(self):

🅼 json

@property
def json(self):

🅼 add_on_update_call_back

def add_on_update_call_back(self, func: Callable):

🅼 set_start_update_intervel

def set_start_update_intervel(self, intervel=1.0) -> None: