sysinfo

System metrics and process inspection library.

sysinfo
metrics
moon add Milky2018/sysinfo@0.1.2
Download zip
Author
Version
0.1.2
License
Apache-2.0
Last updated
4 months ago
Downloads
718

Dependencies

README

#Milky2018/sysinfo

A MoonBit-native system metrics and process inspection library for Linux and macOS.

#Status

  • native target only.
  • Linux: fully supported.
  • macOS: fully supported.
  • Other OSes: unsupported semantics (is_supported_system == false, APIs return None, empty collections, or no-op defaults instead of panicking).

#Install

moon add Milky2018/sysinfo

#Quick Start

let system = @sysinfo.System::new_all()

println("supported=\{@sysinfo.is_supported_system}")
println("total_memory=\{system.total_memory()}")
println("used_memory=\{system.used_memory()}")
println("cpu_usage=\{system.global_cpu_usage()}")
println("process_count=\{system.processes().size()}")

#Refresh Semantics

sysinfo-style delta metrics require at least two refreshes with an interval:

  • CPU usage
  • Network traffic deltas
  • Process CPU usage

MINIMUM_CPU_UPDATE_INTERVAL is fixed to 200 ms.

let system = @sysinfo.System::new_all()
system.refresh_cpu_usage()

sleep(220)

system.refresh_cpu_usage()
let usage = system.global_cpu_usage()

#Main API Surface

  • System: System, RefreshKind, CpuRefreshKind, MemoryRefreshKind, ProcessRefreshKind
  • Process: Process, Pid, Uid, Gid, ProcessStatus, ThreadKind, Signal, KillError
  • CPU: Cpu
  • Disks: Disks, Disk, DiskKind, DiskRefreshKind, DiskUsage
  • Networks: Networks, NetworkData, MacAddr, IpNetwork
  • Components: Components, Component
  • Users/Groups: Users, User, Groups, Group
  • Globals: is_supported_system, MINIMUM_CPU_UPDATE_INTERVAL, supported_signals

#Process Control

Supported process-control APIs:

  • Process::kill()
  • Process::kill_with(signal)
  • Process::wait()
  • Process::kill_and_wait()
  • Process::kill_with_and_wait(signal)

On unsupported systems, these return unsupported-safe values (None/Err(KillError::Unsupported)), matching the library's non-panicking downgrade policy.

#Notes

  • set_open_files_limit and System::open_files_limit follow upstream behavior:
    • Linux: implemented.
    • macOS: set returns false; query may return a system limit when available.
  • supported_signals exposes the signal list supported by this binding.

#
CGroupLimits

pub(all) struct CGroupLimits {
total_memory : UInt64
free_memory : UInt64
free_swap : UInt64
}

impl Eq for CGroupLimits

#
Component

pub(all) struct Component {
temperature : Double?
max : Double?
critical : Double?
label : String
id : String?
}

impl Eq for Component
impl Show for Component

#
Component::critical

fn Component::critical(self : Component) -> Double?

#
Component::id

fn Component::id(self : Component) -> String?

#
Component::label

fn Component::label(self : Component) -> String

#
Component::max

fn Component::max(self : Component) -> Double?

#
Component::refresh

fn Component::refresh(self : Component) -> Unit

#
Component::temperature

fn Component::temperature(self : Component) -> Double?

#
Components

pub(all) struct Components {
components_data : Array[Component]
}

impl Show for Components

#
Components::list

fn Components::list(self : Components) -> Array[Component]

#
Components::list_mut

fn Components::list_mut(self : Components) -> Array[Component]

#
Components::new

fn Components::new() -> Components

#
Components::new_with_refreshed_list

fn Components::new_with_refreshed_list() -> Components

#
Components::refresh

fn Components::refresh(self : Components, remove_not_listed_components : Bool) -> Unit

#
Cpu

pub(all) struct Cpu {
name : String
vendor_id : String
brand : String
frequency : UInt64
cpu_usage : Double
}

impl Eq for Cpu
impl Show for Cpu

#
Cpu::brand

fn Cpu::brand(self : Cpu) -> String

#
Cpu::cpu_usage

fn Cpu::cpu_usage(self : Cpu) -> Double

#
Cpu::frequency

fn Cpu::frequency(self : Cpu) -> UInt64

#
Cpu::name

fn Cpu::name(self : Cpu) -> String

#
Cpu::vendor_id

fn Cpu::vendor_id(self : Cpu) -> String

#
CpuRefreshKind

pub(all) struct CpuRefreshKind {
cpu_usage : Bool
frequency : Bool
}

#
CpuRefreshKind::cpu_usage

fn CpuRefreshKind::cpu_usage(self : CpuRefreshKind) -> Bool

#
CpuRefreshKind::everything

fn CpuRefreshKind::everything() -> CpuRefreshKind

#
CpuRefreshKind::frequency

fn CpuRefreshKind::frequency(self : CpuRefreshKind) -> Bool

#
CpuRefreshKind::nothing

#
CpuRefreshKind::with_cpu_usage

fn CpuRefreshKind::with_cpu_usage(self : CpuRefreshKind) -> CpuRefreshKind

#
CpuRefreshKind::with_frequency

fn CpuRefreshKind::with_frequency(self : CpuRefreshKind) -> CpuRefreshKind

#
CpuRefreshKind::without_cpu_usage

fn CpuRefreshKind::without_cpu_usage(self : CpuRefreshKind) -> CpuRefreshKind

#
CpuRefreshKind::without_frequency

fn CpuRefreshKind::without_frequency(self : CpuRefreshKind) -> CpuRefreshKind

#
CpuSnapshot

type CpuSnapshot

impl Eq for CpuSnapshot
impl Show for CpuSnapshot

#
Disk

pub(all) struct Disk {
kind : DiskKind
name : String
file_system : String
mount_point : String
total_space : UInt64
available_space : UInt64
is_removable : Bool
is_read_only : Bool
usage : DiskUsage
}

impl Eq for Disk
impl Show for Disk

#
Disk::available_space

fn Disk::available_space(self : Disk) -> UInt64

#
Disk::file_system

fn Disk::file_system(self : Disk) -> String

#
Disk::is_read_only

fn Disk::is_read_only(self : Disk) -> Bool

#
Disk::is_removable

fn Disk::is_removable(self : Disk) -> Bool

#
Disk::kind

fn Disk::kind(self : Disk) -> DiskKind

#
Disk::mount_point

fn Disk::mount_point(self : Disk) -> String

#
Disk::name

fn Disk::name(self : Disk) -> String

#
Disk::refresh

fn Disk::refresh(self : Disk) -> Bool

#
Disk::refresh_specifics

fn Disk::refresh_specifics(self : Disk, refreshes : DiskRefreshKind) -> Bool

#
Disk::total_space

fn Disk::total_space(self : Disk) -> UInt64

#
Disk::usage

fn Disk::usage(self : Disk) -> DiskUsage

#
DiskIoSnapshot

type DiskIoSnapshot

#
DiskKind

pub(all) enum DiskKind {
HDD
SSD
Unknown(String)
}

impl Eq for DiskKind
impl Show for DiskKind

#
DiskRefreshKind

pub(all) struct DiskRefreshKind {
kind : Bool
storage : Bool
io_usage : Bool
}

#
DiskRefreshKind::everything

fn DiskRefreshKind::everything() -> DiskRefreshKind

#
DiskRefreshKind::io_usage

fn DiskRefreshKind::io_usage(self : DiskRefreshKind) -> Bool

#
DiskRefreshKind::kind

fn DiskRefreshKind::kind(self : DiskRefreshKind) -> Bool

#
DiskRefreshKind::nothing

#
DiskRefreshKind::storage

fn DiskRefreshKind::storage(self : DiskRefreshKind) -> Bool

#
DiskRefreshKind::with_io_usage

fn DiskRefreshKind::with_io_usage(self : DiskRefreshKind) -> DiskRefreshKind

#
DiskRefreshKind::with_kind

#
DiskRefreshKind::with_storage

fn DiskRefreshKind::with_storage(self : DiskRefreshKind) -> DiskRefreshKind

#
DiskRefreshKind::without_io_usage

fn DiskRefreshKind::without_io_usage(self : DiskRefreshKind) -> DiskRefreshKind

#
DiskRefreshKind::without_kind

fn DiskRefreshKind::without_kind(self : DiskRefreshKind) -> DiskRefreshKind

#
DiskRefreshKind::without_storage

fn DiskRefreshKind::without_storage(self : DiskRefreshKind) -> DiskRefreshKind

#
DiskUsage

pub(all) struct DiskUsage {
total_read_bytes : UInt64
read_bytes : UInt64
total_written_bytes : UInt64
written_bytes : UInt64
}

impl Eq for DiskUsage
impl Show for DiskUsage

#
DiskUsage::zero

fn DiskUsage::zero() -> DiskUsage

#
Disks

pub(all) struct Disks {
disks_data : Array[Disk]
}

impl Show for Disks

#
Disks::list

fn Disks::list(self : Disks) -> Array[Disk]

#
Disks::list_mut

fn Disks::list_mut(self : Disks) -> Array[Disk]

#
Disks::new

fn Disks::new() -> Disks

#
Disks::new_with_refreshed_list

fn Disks::new_with_refreshed_list() -> Disks

#
Disks::new_with_refreshed_list_specifics

fn Disks::new_with_refreshed_list_specifics(refreshes : DiskRefreshKind) -> Disks

#
Disks::refresh

fn Disks::refresh(self : Disks, remove_not_listed_disks : Bool) -> Unit

#
Disks::refresh_specifics

fn Disks::refresh_specifics(self : Disks, remove_not_listed_disks : Bool, refreshes : DiskRefreshKind) -> Unit

#
ExitStatus

pub(all) struct ExitStatus {
code : Int?
signal : Signal?
success : Bool
}

impl Eq for ExitStatus
impl Show for ExitStatus

#
ExitStatus::from_code

fn ExitStatus::from_code(code : Int) -> ExitStatus

#
ExitStatus::from_signal

fn ExitStatus::from_signal(signal : Signal) -> ExitStatus

#
Gid

pub(all) struct Gid {
value : Int
}

impl Compare for Gid
impl Eq for Gid
impl Hash for Gid
impl Show for Gid

#
Gid::from

fn Gid::from(value : Int) -> Gid

#
Gid::to_int

fn Gid::to_int(self : Gid) -> Int

#
Group

pub(all) struct Group {
id : Gid
name : String
}

impl Eq for Group
impl Show for Group

#
Group::id

fn Group::id(self : Group) -> Gid

#
Group::name

fn Group::name(self : Group) -> String

#
Groups

pub(all) struct Groups {
groups_data : Array[Group]
}

impl Show for Groups

#
Groups::list

fn Groups::list(self : Groups) -> Array[Group]

#
Groups::list_mut

fn Groups::list_mut(self : Groups) -> Array[Group]

#
Groups::new

fn Groups::new() -> Groups

#
Groups::new_with_refreshed_list

fn Groups::new_with_refreshed_list() -> Groups

#
Groups::refresh

fn Groups::refresh(self : Groups) -> Unit

#
IpNetwork

pub(all) struct IpNetwork {
raw : String
}

impl Eq for IpNetwork
impl Show for IpNetwork

#
IpNetwork::to_string

fn IpNetwork::to_string(self : IpNetwork) -> String

#
KillError

pub(all) enum KillError {
Unsupported
NotFound
PermissionDenied
Timeout
WaitFailed
Unknown(String)
}

impl Eq for KillError
impl Show for KillError

#
LoadAvg

pub(all) struct LoadAvg {
one : Double
five : Double
fifteen : Double
}

impl Eq for LoadAvg
impl Show for LoadAvg

#
LoadAvg::zero

fn LoadAvg::zero() -> LoadAvg

#
MacAddr

pub(all) struct MacAddr {
raw : String
}

impl Eq for MacAddr
impl Show for MacAddr

#
MacAddr::is_unspecified

fn MacAddr::is_unspecified(self : MacAddr) -> Bool

#
MacAddr::to_string

fn MacAddr::to_string(self : MacAddr) -> String

#
MacosDiskInfo

type MacosDiskInfo

impl Eq for MacosDiskInfo

#
MemoryRefreshKind

pub(all) struct MemoryRefreshKind {
ram : Bool
swap : Bool
}

#
MemoryRefreshKind::everything

#
MemoryRefreshKind::nothing

#
MemoryRefreshKind::ram

fn MemoryRefreshKind::ram(self : MemoryRefreshKind) -> Bool

#
MemoryRefreshKind::swap

fn MemoryRefreshKind::swap(self : MemoryRefreshKind) -> Bool

#
MemoryRefreshKind::with_ram

#
MemoryRefreshKind::with_swap

#
MemoryRefreshKind::without_ram

#
MemoryRefreshKind::without_swap

#
MountEntry

type MountEntry

impl Eq for MountEntry
impl Show for MountEntry

#
NetworkData

pub(all) struct NetworkData {
received : UInt64
total_received : UInt64
transmitted : UInt64
total_transmitted : UInt64
packets_received : UInt64
total_packets_received : UInt64
packets_transmitted : UInt64
total_packets_transmitted : UInt64
errors_on_received : UInt64
total_errors_on_received : UInt64
errors_on_transmitted : UInt64
total_errors_on_transmitted : UInt64
mac_address : MacAddr
ip_networks : Array[IpNetwork]
mtu : UInt64
}

impl Eq for NetworkData
impl Show for NetworkData

#
NetworkData::errors_on_received

fn NetworkData::errors_on_received(self : NetworkData) -> UInt64

#
NetworkData::errors_on_transmitted

fn NetworkData::errors_on_transmitted(self : NetworkData) -> UInt64

#
NetworkData::ip_networks

fn NetworkData::ip_networks(self : NetworkData) -> Array[IpNetwork]

#
NetworkData::mac_address

fn NetworkData::mac_address(self : NetworkData) -> MacAddr

#
NetworkData::mtu

fn NetworkData::mtu(self : NetworkData) -> UInt64

#
NetworkData::packets_received

fn NetworkData::packets_received(self : NetworkData) -> UInt64

#
NetworkData::packets_transmitted

fn NetworkData::packets_transmitted(self : NetworkData) -> UInt64

#
NetworkData::received

fn NetworkData::received(self : NetworkData) -> UInt64

#
NetworkData::total_errors_on_received

fn NetworkData::total_errors_on_received(self : NetworkData) -> UInt64

#
NetworkData::total_errors_on_transmitted

fn NetworkData::total_errors_on_transmitted(self : NetworkData) -> UInt64

#
NetworkData::total_packets_received

fn NetworkData::total_packets_received(self : NetworkData) -> UInt64

#
NetworkData::total_packets_transmitted

fn NetworkData::total_packets_transmitted(self : NetworkData) -> UInt64

#
NetworkData::total_received

fn NetworkData::total_received(self : NetworkData) -> UInt64

#
NetworkData::total_transmitted

fn NetworkData::total_transmitted(self : NetworkData) -> UInt64

#
NetworkData::transmitted

fn NetworkData::transmitted(self : NetworkData) -> UInt64

#
Networks

pub(all) struct Networks {
networks_data : Map[String, NetworkData]
}

impl Show for Networks

#
Networks::list

fn Networks::list(self : Networks) -> Map[String, NetworkData]

#
Networks::new

fn Networks::new() -> Networks

#
Networks::new_with_refreshed_list

fn Networks::new_with_refreshed_list() -> Networks

#
Networks::refresh

fn Networks::refresh(self : Networks, remove_not_listed_interfaces : Bool) -> Unit

#
Pid

pub(all) struct Pid {
value : Int
}

impl Compare for Pid
impl Eq for Pid
impl Hash for Pid
impl Show for Pid

#
Pid::as_u32

fn Pid::as_u32(self : Pid) -> UInt

#
Pid::from

fn Pid::from(value : Int) -> Pid

#
Pid::from_u32

fn Pid::from_u32(value : UInt) -> Pid

#
Pid::to_int

fn Pid::to_int(self : Pid) -> Int

#
Process

pub(all) struct Process {
pid : Pid
parent : Pid?
name : String
cmd : Array[String]
environ : Array[String]
exe : String?
cwd : String?
root : String?
memory : UInt64
virtual_memory : UInt64
status : ProcessStatus
start_time : UInt64
run_time : UInt64
cpu_usage : Double
accumulated_cpu_time : UInt64
disk_usage : DiskUsage
user_id : Uid?
effective_user_id : Uid?
group_id : Gid?
effective_group_id : Gid?
session_id : Pid?
tasks : Array[Pid]?
thread_kind : ThreadKind?
open_files : Int?
open_files_limit : Int?
}

impl Eq for Process
impl Show for Process

#
Process::accumulated_cpu_time

fn Process::accumulated_cpu_time(self : Process) -> UInt64

#
Process::cmd

fn Process::cmd(self : Process) -> Array[String]

#
Process::cpu_usage

fn Process::cpu_usage(self : Process) -> Double

#
Process::cwd

fn Process::cwd(self : Process) -> String?

#
Process::disk_usage

fn Process::disk_usage(self : Process) -> DiskUsage

#
Process::effective_group_id

fn Process::effective_group_id(self : Process) -> Gid?

#
Process::effective_user_id

fn Process::effective_user_id(self : Process) -> Uid?

#
Process::environ

fn Process::environ(self : Process) -> Array[String]

#
Process::exe

fn Process::exe(self : Process) -> String?

#
Process::exists

fn Process::exists(self : Process) -> Bool

#
Process::group_id

fn Process::group_id(self : Process) -> Gid?

#
Process::kill

fn Process::kill(self : Process) -> Bool

#
Process::kill_and_wait

fn Process::kill_and_wait(self : Process) -> Result[ExitStatus?, KillError]

#
Process::kill_with

fn Process::kill_with(self : Process, signal : Signal) -> Bool?

#
Process::kill_with_and_wait

fn Process::kill_with_and_wait(self : Process, signal : Signal) -> Result[ExitStatus?, KillError]

#
Process::memory

fn Process::memory(self : Process) -> UInt64

#
Process::name

fn Process::name(self : Process) -> String

#
Process::open_files

fn Process::open_files(self : Process) -> Int?

#
Process::open_files_limit

fn Process::open_files_limit(self : Process) -> Int?

#
Process::parent

fn Process::parent(self : Process) -> Pid?

#
Process::pid

fn Process::pid(self : Process) -> Pid

#
Process::root

fn Process::root(self : Process) -> String?

#
Process::run_time

fn Process::run_time(self : Process) -> UInt64

#
Process::session_id

fn Process::session_id(self : Process) -> Pid?

#
Process::start_time

fn Process::start_time(self : Process) -> UInt64

#
Process::status

fn Process::status(self : Process) -> ProcessStatus

#
Process::tasks

fn Process::tasks(self : Process) -> Array[Pid]?

#
Process::thread_kind

fn Process::thread_kind(self : Process) -> ThreadKind?

#
Process::user_id

fn Process::user_id(self : Process) -> Uid?

#
Process::virtual_memory

fn Process::virtual_memory(self : Process) -> UInt64

#
Process::wait

fn Process::wait(self : Process) -> ExitStatus?

#
ProcessRefreshKind

pub(all) struct ProcessRefreshKind {
cpu : Bool
disk_usage : Bool
memory : Bool
user : UpdateKind
cwd : UpdateKind
root : UpdateKind
environ : UpdateKind
cmd : UpdateKind
exe : UpdateKind
tasks : Bool
}

#
ProcessRefreshKind::cmd

#
ProcessRefreshKind::cpu

fn ProcessRefreshKind::cpu(self : ProcessRefreshKind) -> Bool

#
ProcessRefreshKind::cwd

#
ProcessRefreshKind::disk_usage

fn ProcessRefreshKind::disk_usage(self : ProcessRefreshKind) -> Bool

#
ProcessRefreshKind::environ

#
ProcessRefreshKind::everything

#
ProcessRefreshKind::exe

#
ProcessRefreshKind::memory

fn ProcessRefreshKind::memory(self : ProcessRefreshKind) -> Bool

#
ProcessRefreshKind::nothing

#
ProcessRefreshKind::root

#
ProcessRefreshKind::tasks

fn ProcessRefreshKind::tasks(self : ProcessRefreshKind) -> Bool

#
ProcessRefreshKind::user

#
ProcessRefreshKind::with_cmd

#
ProcessRefreshKind::with_cpu

#
ProcessRefreshKind::with_cwd

#
ProcessRefreshKind::with_disk_usage

#
ProcessRefreshKind::with_environ

#
ProcessRefreshKind::with_exe

#
ProcessRefreshKind::with_memory

#
ProcessRefreshKind::with_root

#
ProcessRefreshKind::with_tasks

#
ProcessRefreshKind::with_user

#
ProcessRefreshKind::without_cmd

#
ProcessRefreshKind::without_cpu

#
ProcessRefreshKind::without_cwd

#
ProcessRefreshKind::without_disk_usage

fn ProcessRefreshKind::without_disk_usage(self : ProcessRefreshKind) -> ProcessRefreshKind

#
ProcessRefreshKind::without_environ

#
ProcessRefreshKind::without_exe

#
ProcessRefreshKind::without_memory

#
ProcessRefreshKind::without_root

#
ProcessRefreshKind::without_tasks

#
ProcessRefreshKind::without_user

#
ProcessStatus

pub(all) enum ProcessStatus {
Dead
Idle
LockBlocked
Parked
Run
Sleep
Stop
Suspended
Tracing
UninterruptibleDiskSleep
Unknown(Int)
Wakekill
Waking
Zombie
}

impl Eq for ProcessStatus

#
ProcessesToUpdate

pub(all) enum ProcessesToUpdate {
All
Selected(Array[Pid])
}

#
RefreshKind

pub(all) struct RefreshKind {
processes : ProcessRefreshKind?
memory : MemoryRefreshKind?
cpu : CpuRefreshKind?
}

impl Eq for RefreshKind
impl Show for RefreshKind

#
RefreshKind::cpu

#
RefreshKind::everything

fn RefreshKind::everything() -> RefreshKind

#
RefreshKind::memory

#
RefreshKind::nothing

fn RefreshKind::nothing() -> RefreshKind

#
RefreshKind::processes

fn RefreshKind::processes(self : RefreshKind) -> ProcessRefreshKind?

#
RefreshKind::with_cpu

fn RefreshKind::with_cpu(self : RefreshKind, kind : CpuRefreshKind) -> RefreshKind

#
RefreshKind::with_memory

fn RefreshKind::with_memory(self : RefreshKind, kind : MemoryRefreshKind) -> RefreshKind

#
RefreshKind::with_processes

fn RefreshKind::with_processes(self : RefreshKind, kind : ProcessRefreshKind) -> RefreshKind

#
RefreshKind::without_cpu

fn RefreshKind::without_cpu(self : RefreshKind) -> RefreshKind

#
RefreshKind::without_memory

fn RefreshKind::without_memory(self : RefreshKind) -> RefreshKind

#
RefreshKind::without_processes

fn RefreshKind::without_processes(self : RefreshKind) -> RefreshKind

#
Signal

pub(all) enum Signal {
Abort
Alarm
Bus
Child
Continue
FloatingPointException
Hangup
IO
IOT
Illegal
Interrupt
Kill
Pipe
Poll
Power
Profiling
Quit
Segv
Stop
Sys
TSTP
TTIN
TTOU
Term
Trap
Urgent
User1
User2
VirtualAlarm
Winch
XCPU
XFSZ
}

impl Eq for Signal
impl Show for Signal

#
System

pub(all) struct System {
processes_data : Map[Pid, Process]
cpus_data : Array[Cpu]
total_memory_data : UInt64
free_memory_data : UInt64
available_memory_data : UInt64
used_memory_data : UInt64
total_swap_data : UInt64
free_swap_data : UInt64
used_swap_data : UInt64
cgroup_limits_data : CGroupLimits?
last_cpu_refresh_ms : UInt64
prev_cpu_snapshots : Array[CpuSnapshot]
prev_global_cpu_snapshot : CpuSnapshot?
prev_proc_cpu_total : Map[Pid, UInt64]
prev_proc_system_total : UInt64
}

#
System::available_memory

fn System::available_memory(self : System) -> UInt64

#
System::boot_time

fn System::boot_time() -> UInt64

#
System::cgroup_limits

fn System::cgroup_limits(self : System) -> CGroupLimits?

#
System::cpu_arch

fn System::cpu_arch() -> String

#
System::cpus

fn System::cpus(self : System) -> Array[Cpu]

#
System::distribution_id

fn System::distribution_id() -> String

#
System::distribution_id_like

fn System::distribution_id_like() -> Array[String]

#
System::free_memory

fn System::free_memory(self : System) -> UInt64

#
System::free_swap

fn System::free_swap(self : System) -> UInt64

#
System::global_cpu_usage

fn System::global_cpu_usage(self : System) -> Double

#
System::host_name

fn System::host_name() -> String?

#
System::kernel_long_version

fn System::kernel_long_version() -> String

#
System::kernel_version

fn System::kernel_version() -> String?

#
System::load_average

fn System::load_average() -> LoadAvg

#
System::long_os_version

fn System::long_os_version() -> String?

#
System::name

fn System::name() -> String?

#
System::new

fn System::new() -> System

#
System::new_all

fn System::new_all() -> System

#
System::new_with_specifics

fn System::new_with_specifics(refreshes : RefreshKind) -> System

#
System::open_files_limit

fn System::open_files_limit() -> Int?

#
System::os_version

fn System::os_version() -> String?

#
System::physical_core_count

fn System::physical_core_count() -> Int?

#
System::process

fn System::process(self : System, pid : Pid) -> Process?

#
System::processes

fn System::processes(self : System) -> Map[Pid, Process]

#
System::processes_by_exact_name

fn System::processes_by_exact_name(self : System, name : String) -> Array[(Pid, Process)]

#
System::processes_by_name

fn System::processes_by_name(self : System, name : String) -> Array[(Pid, Process)]

#
System::refresh_all

fn System::refresh_all(self : System) -> Unit

#
System::refresh_cpu_all

fn System::refresh_cpu_all(self : System) -> Unit

#
System::refresh_cpu_frequency

fn System::refresh_cpu_frequency(self : System) -> Unit

#
System::refresh_cpu_list

fn System::refresh_cpu_list(self : System, refresh_kind : CpuRefreshKind) -> Unit

#
System::refresh_cpu_specifics

fn System::refresh_cpu_specifics(self : System, refresh_kind : CpuRefreshKind) -> Unit

#
System::refresh_cpu_usage

fn System::refresh_cpu_usage(self : System) -> Unit

#
System::refresh_memory

fn System::refresh_memory(self : System) -> Unit

#
System::refresh_memory_specifics

fn System::refresh_memory_specifics(self : System, refresh_kind : MemoryRefreshKind) -> Unit

#
System::refresh_processes

fn System::refresh_processes(self : System, processes_to_update : ProcessesToUpdate, remove_dead_processes : Bool) -> Int

#
System::refresh_processes_specifics

fn System::refresh_processes_specifics(self : System, processes_to_update : ProcessesToUpdate, remove_dead_processes : Bool, refresh_kind : ProcessRefreshKind) -> Int

#
System::refresh_specifics

fn System::refresh_specifics(self : System, refreshes : RefreshKind) -> Unit

#
System::total_memory

fn System::total_memory(self : System) -> UInt64

#
System::total_swap

fn System::total_swap(self : System) -> UInt64

#
System::uptime

fn System::uptime() -> UInt64

#
System::used_memory

fn System::used_memory(self : System) -> UInt64

#
System::used_swap

fn System::used_swap(self : System) -> UInt64

#
ThreadKind

pub(all) enum ThreadKind {
Kernel
Userland
}

impl Eq for ThreadKind
impl Show for ThreadKind

#
Uid

pub(all) struct Uid {
value : Int
}

impl Compare for Uid
impl Eq for Uid
impl Hash for Uid
impl Show for Uid

#
Uid::from

fn Uid::from(value : Int) -> Uid

#
Uid::to_int

fn Uid::to_int(self : Uid) -> Int

#
UpdateKind

pub(all) enum UpdateKind {
Never
Always
OnlyIfNotSet
}

impl Eq for UpdateKind
impl Show for UpdateKind

#
User

pub(all) struct User {
id : Uid
group_id : Gid
name : String
groups : Array[Group]
}

impl Eq for User
impl Show for User

#
User::group_id

fn User::group_id(self : User) -> Gid

#
User::groups

fn User::groups(self : User) -> Array[Group]

#
User::id

fn User::id(self : User) -> Uid

#
User::name

fn User::name(self : User) -> String

#
Users

pub(all) struct Users {
users_data : Array[User]
}

impl Show for Users

#
Users::get_user_by_id

fn Users::get_user_by_id(self : Users, user_id : Uid) -> User?

#
Users::list

fn Users::list(self : Users) -> Array[User]

#
Users::list_mut

fn Users::list_mut(self : Users) -> Array[User]

#
Users::new

fn Users::new() -> Users

#
Users::new_with_refreshed_list

fn Users::new_with_refreshed_list() -> Users

#
Users::refresh

fn Users::refresh(self : Users) -> Unit

#
MINIMUM_CPU_UPDATE_INTERVAL

let MINIMUM_CPU_UPDATE_INTERVAL : Int

#
get_current_pid

fn get_current_pid() -> Result[Pid, String]

#
is_supported_system

let is_supported_system : Bool

#
set_open_files_limit

fn set_open_files_limit(new_limit : Int) -> Bool

#
supported_signals

let supported_signals : Array[Signal]