sysinfo

    System metrics and process inspection library.

    sysinfo
    metrics
    Download zip
    Author
    Version
    0.1.4
    License
    Apache-2.0
    Last updated
    48 minutes ago
    Downloads
    729

    Dependencies

    #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
    } derive(Eq,
    Debug
    )

    CGroupLimits::equal

    CGroupLimits::not_equal

    fn CGroupLimits::not_equal(x : CGroupLimits, y : CGroupLimits) -> Bool

    CGroupLimits::output

    fn CGroupLimits::output(self : CGroupLimits, logger : &Logger) -> Unit

    CGroupLimits::to_string

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

    Component

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

    impl Show for Component

    Component::critical

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

    Component::equal

    fn Component::equal(Component, Component) -> Bool

    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::not_equal

    fn Component::not_equal(x : Component, y : Component) -> Bool

    Component::output

    fn Component::output(self : Component, logger : &Logger) -> Unit

    Component::refresh

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

    Component::temperature

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

    Component::to_string

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

    Components

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

    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::output

    fn Components::output(self : Components, logger : &Logger) -> Unit

    Components::refresh

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

    Components::to_string

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

    Cpu

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

    impl Show for Cpu

    Cpu::brand

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

    Cpu::cpu_usage

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

    Cpu::equal

    fn Cpu::equal(Cpu, Cpu) -> Bool

    Cpu::frequency

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

    Cpu::name

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

    Cpu::not_equal

    fn Cpu::not_equal(x : Cpu, y : Cpu) -> Bool

    Cpu::output

    fn Cpu::output(self : Cpu, logger : &Logger) -> Unit

    Cpu::to_repr

    Cpu::to_string

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

    Cpu::vendor_id

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

    CpuRefreshKind

    pub(all) struct CpuRefreshKind {
    cpu_usage : Bool
    frequency : Bool
    } derive(Eq,
    Debug
    )

    CpuRefreshKind::cpu_usage

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

    CpuRefreshKind::equal

    CpuRefreshKind::everything

    fn CpuRefreshKind::everything() -> CpuRefreshKind

    CpuRefreshKind::frequency

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

    CpuRefreshKind::not_equal

    fn CpuRefreshKind::not_equal(x : CpuRefreshKind, y : CpuRefreshKind) -> Bool

    CpuRefreshKind::nothing

    CpuRefreshKind::output

    fn CpuRefreshKind::output(self : CpuRefreshKind, logger : &Logger) -> Unit

    CpuRefreshKind::to_string

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

    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 derive(Eq,
    Debug
    )

    impl Show for CpuSnapshot

    CpuSnapshot::equal

    fn CpuSnapshot::equal(CpuSnapshot, CpuSnapshot) -> Bool

    CpuSnapshot::not_equal

    fn CpuSnapshot::not_equal(x : CpuSnapshot, y : CpuSnapshot) -> Bool

    CpuSnapshot::output

    fn CpuSnapshot::output(self : CpuSnapshot, logger : &Logger) -> Unit

    CpuSnapshot::to_string

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

    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
    } derive(Eq,
    Debug
    )

    impl Show for Disk

    Disk::available_space

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

    Disk::equal

    fn Disk::equal(Disk, Disk) -> Bool

    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::not_equal

    fn Disk::not_equal(x : Disk, y : Disk) -> Bool

    Disk::output

    fn Disk::output(self : Disk, logger : &Logger) -> Unit

    Disk::refresh

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

    Disk::refresh_specifics

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

    Disk::to_repr

    Disk::to_string

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

    Disk::total_space

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

    Disk::usage

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

    DiskIoSnapshot

    type DiskIoSnapshot derive(Eq,
    Debug
    )

    DiskIoSnapshot::equal

    DiskIoSnapshot::not_equal

    fn DiskIoSnapshot::not_equal(x : DiskIoSnapshot, y : DiskIoSnapshot) -> Bool

    DiskIoSnapshot::output

    fn DiskIoSnapshot::output(self : DiskIoSnapshot, logger : &Logger) -> Unit

    DiskIoSnapshot::to_string

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

    DiskKind

    pub(all) enum DiskKind {
    HDD
    SSD
    Unknown(String)
    } derive(Eq,
    Debug
    )

    impl Show for DiskKind

    DiskKind::equal

    fn DiskKind::equal(DiskKind, DiskKind) -> Bool

    DiskKind::not_equal

    fn DiskKind::not_equal(x : DiskKind, y : DiskKind) -> Bool

    DiskKind::output

    fn DiskKind::output(self : DiskKind, logger : &Logger) -> Unit

    DiskKind::to_repr

    DiskKind::to_string

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

    DiskRefreshKind

    pub(all) struct DiskRefreshKind {
    kind : Bool
    storage : Bool
    io_usage : Bool
    } derive(Eq,
    Debug
    )

    DiskRefreshKind::equal

    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::not_equal

    fn DiskRefreshKind::not_equal(x : DiskRefreshKind, y : DiskRefreshKind) -> Bool

    DiskRefreshKind::nothing

    DiskRefreshKind::output

    fn DiskRefreshKind::output(self : DiskRefreshKind, logger : &Logger) -> Unit

    DiskRefreshKind::storage

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

    DiskRefreshKind::to_string

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

    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
    } derive(Eq,
    Debug
    )

    impl Show for DiskUsage

    DiskUsage::equal

    fn DiskUsage::equal(DiskUsage, DiskUsage) -> Bool

    DiskUsage::not_equal

    fn DiskUsage::not_equal(x : DiskUsage, y : DiskUsage) -> Bool

    DiskUsage::output

    fn DiskUsage::output(self : DiskUsage, logger : &Logger) -> Unit

    DiskUsage::to_string

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

    DiskUsage::zero

    fn DiskUsage::zero() -> DiskUsage

    Disks

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

    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::output

    fn Disks::output(self : Disks, logger : &Logger) -> Unit

    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

    Disks::to_repr

    Disks::to_string

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

    ExitStatus

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

    impl Show for ExitStatus

    ExitStatus::equal

    fn ExitStatus::equal(ExitStatus, ExitStatus) -> Bool

    ExitStatus::from_code

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

    ExitStatus::from_signal

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

    ExitStatus::not_equal

    fn ExitStatus::not_equal(x : ExitStatus, y : ExitStatus) -> Bool

    ExitStatus::output

    fn ExitStatus::output(self : ExitStatus, logger : &Logger) -> Unit

    ExitStatus::to_string

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

    Gid

    pub(all) struct Gid {
    value : Int
    } derive(Compare, Eq, Hash,
    Debug
    )

    impl Show for Gid

    Gid::compare

    fn Gid::compare(Gid, Gid) -> Int

    Gid::equal

    fn Gid::equal(Gid, Gid) -> Bool

    Gid::from

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

    Gid::hash

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

    Gid::hash_combine

    fn Gid::hash_combine(Gid, Hasher) -> Unit

    Gid::not_equal

    fn Gid::not_equal(x : Gid, y : Gid) -> Bool

    Gid::op_ge

    fn Gid::op_ge(x : Gid, y : Gid) -> Bool

    Gid::op_gt

    fn Gid::op_gt(x : Gid, y : Gid) -> Bool

    Gid::op_le

    fn Gid::op_le(x : Gid, y : Gid) -> Bool

    Gid::op_lt

    fn Gid::op_lt(x : Gid, y : Gid) -> Bool

    Gid::output

    fn Gid::output(self : Gid, logger : &Logger) -> Unit

    Gid::to_int

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

    Gid::to_repr

    Gid::to_string

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

    Group

    pub(all) struct Group {
    id : Gid
    name : String
    } derive(Eq,
    Debug
    )

    impl Show for Group

    Group::equal

    fn Group::equal(Group, Group) -> Bool

    Group::id

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

    Group::name

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

    Group::not_equal

    fn Group::not_equal(x : Group, y : Group) -> Bool

    Group::output

    fn Group::output(self : Group, logger : &Logger) -> Unit

    Group::to_repr

    Group::to_string

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

    Groups

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

    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::output

    fn Groups::output(self : Groups, logger : &Logger) -> Unit

    Groups::refresh

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

    Groups::to_repr

    Groups::to_string

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

    IpNetwork

    pub(all) struct IpNetwork {
    raw : String
    } derive(Eq,
    Debug
    )

    impl Show for IpNetwork

    IpNetwork::equal

    fn IpNetwork::equal(IpNetwork, IpNetwork) -> Bool

    IpNetwork::not_equal

    fn IpNetwork::not_equal(x : IpNetwork, y : IpNetwork) -> Bool

    IpNetwork::output

    fn IpNetwork::output(self : IpNetwork, logger : &Logger) -> Unit

    IpNetwork::to_string

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

    KillError

    pub(all) enum KillError {
    Unsupported
    NotFound
    PermissionDenied
    Timeout
    WaitFailed
    Unknown(String)
    } derive(Eq,
    Debug
    )

    impl Show for KillError

    KillError::equal

    fn KillError::equal(KillError, KillError) -> Bool

    KillError::not_equal

    fn KillError::not_equal(x : KillError, y : KillError) -> Bool

    KillError::output

    fn KillError::output(self : KillError, logger : &Logger) -> Unit

    KillError::to_string

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

    LoadAvg

    pub(all) struct LoadAvg {
    one : Double
    five : Double
    fifteen : Double
    } derive(Eq,
    Debug
    )

    impl Show for LoadAvg

    LoadAvg::equal

    fn LoadAvg::equal(LoadAvg, LoadAvg) -> Bool

    LoadAvg::not_equal

    fn LoadAvg::not_equal(x : LoadAvg, y : LoadAvg) -> Bool

    LoadAvg::output

    fn LoadAvg::output(self : LoadAvg, logger : &Logger) -> Unit

    LoadAvg::to_repr

    LoadAvg::to_string

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

    LoadAvg::zero

    fn LoadAvg::zero() -> LoadAvg

    MacAddr

    pub(all) struct MacAddr {
    raw : String
    } derive(Eq,
    Debug
    )

    impl Show for MacAddr

    MacAddr::equal

    fn MacAddr::equal(MacAddr, MacAddr) -> Bool

    MacAddr::is_unspecified

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

    MacAddr::not_equal

    fn MacAddr::not_equal(x : MacAddr, y : MacAddr) -> Bool

    MacAddr::output

    fn MacAddr::output(self : MacAddr, logger : &Logger) -> Unit

    MacAddr::to_repr

    MacAddr::to_string

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

    MacosDiskInfo

    type MacosDiskInfo derive(Eq,
    Debug
    )

    MacosDiskInfo::equal

    MacosDiskInfo::not_equal

    fn MacosDiskInfo::not_equal(x : MacosDiskInfo, y : MacosDiskInfo) -> Bool

    MacosDiskInfo::output

    fn MacosDiskInfo::output(self : MacosDiskInfo, logger : &Logger) -> Unit

    MacosDiskInfo::to_string

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

    MemoryRefreshKind

    pub(all) struct MemoryRefreshKind {
    ram : Bool
    swap : Bool
    } derive(Eq,
    Debug
    )

    MemoryRefreshKind::equal

    MemoryRefreshKind::everything

    MemoryRefreshKind::not_equal

    fn MemoryRefreshKind::not_equal(x : MemoryRefreshKind, y : MemoryRefreshKind) -> Bool

    MemoryRefreshKind::nothing

    MemoryRefreshKind::output

    fn MemoryRefreshKind::output(self : MemoryRefreshKind, logger : &Logger) -> Unit

    MemoryRefreshKind::ram

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

    MemoryRefreshKind::swap

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

    MemoryRefreshKind::to_string

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

    MemoryRefreshKind::with_ram

    MemoryRefreshKind::with_swap

    MemoryRefreshKind::without_ram

    MemoryRefreshKind::without_swap

    MountEntry

    type MountEntry derive(Eq,
    Debug
    )

    impl Show for MountEntry

    MountEntry::equal

    fn MountEntry::equal(MountEntry, MountEntry) -> Bool

    MountEntry::not_equal

    fn MountEntry::not_equal(x : MountEntry, y : MountEntry) -> Bool

    MountEntry::output

    fn MountEntry::output(self : MountEntry, logger : &Logger) -> Unit

    MountEntry::to_string

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

    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
    } derive(Eq,
    Debug
    )

    impl Show for NetworkData

    NetworkData::equal

    fn NetworkData::equal(NetworkData, NetworkData) -> Bool

    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::not_equal

    fn NetworkData::not_equal(x : NetworkData, y : NetworkData) -> Bool

    NetworkData::output

    fn NetworkData::output(self : NetworkData, logger : &Logger) -> Unit

    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::to_string

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

    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]
    } derive(
    Debug
    )

    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::output

    fn Networks::output(self : Networks, logger : &Logger) -> Unit

    Networks::refresh

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

    Networks::to_repr

    Networks::to_string

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

    Pid

    pub(all) struct Pid {
    value : Int
    } derive(Compare, Eq, Hash,
    Debug
    )

    impl Show for Pid

    Pid::as_u32

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

    Pid::compare

    fn Pid::compare(Pid, Pid) -> Int

    Pid::equal

    fn Pid::equal(Pid, Pid) -> Bool

    Pid::from

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

    Pid::from_u32

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

    Pid::hash

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

    Pid::hash_combine

    fn Pid::hash_combine(Pid, Hasher) -> Unit

    Pid::not_equal

    fn Pid::not_equal(x : Pid, y : Pid) -> Bool

    Pid::op_ge

    fn Pid::op_ge(x : Pid, y : Pid) -> Bool

    Pid::op_gt

    fn Pid::op_gt(x : Pid, y : Pid) -> Bool

    Pid::op_le

    fn Pid::op_le(x : Pid, y : Pid) -> Bool

    Pid::op_lt

    fn Pid::op_lt(x : Pid, y : Pid) -> Bool

    Pid::output

    fn Pid::output(self : Pid, logger : &Logger) -> Unit

    Pid::to_int

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

    Pid::to_repr

    Pid::to_string

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

    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?
    } derive(Eq,
    Debug
    )

    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::equal

    fn Process::equal(Process, Process) -> Bool

    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::not_equal

    fn Process::not_equal(x : Process, y : Process) -> Bool

    Process::open_files

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

    Process::open_files_limit

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

    Process::output

    fn Process::output(self : Process, logger : &Logger) -> Unit

    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::to_repr

    Process::to_string

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

    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
    } derive(Eq,
    Debug
    )

    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::equal

    ProcessRefreshKind::everything

    ProcessRefreshKind::exe

    ProcessRefreshKind::memory

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

    ProcessRefreshKind::not_equal

    ProcessRefreshKind::nothing

    ProcessRefreshKind::output

    fn ProcessRefreshKind::output(self : ProcessRefreshKind, logger : &Logger) -> Unit

    ProcessRefreshKind::root

    ProcessRefreshKind::tasks

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

    ProcessRefreshKind::to_string

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

    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
    } derive(Eq,
    Debug
    )

    ProcessStatus::equal

    ProcessStatus::not_equal

    fn ProcessStatus::not_equal(x : ProcessStatus, y : ProcessStatus) -> Bool

    ProcessStatus::output

    fn ProcessStatus::output(self : ProcessStatus, logger : &Logger) -> Unit

    ProcessStatus::to_string

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

    ProcessesToUpdate

    pub(all) enum ProcessesToUpdate {
    All
    Selected(Array[Pid])
    } derive(Eq,
    Debug
    )

    ProcessesToUpdate::equal

    ProcessesToUpdate::not_equal

    fn ProcessesToUpdate::not_equal(x : ProcessesToUpdate, y : ProcessesToUpdate) -> Bool

    ProcessesToUpdate::output

    fn ProcessesToUpdate::output(self : ProcessesToUpdate, logger : &Logger) -> Unit

    ProcessesToUpdate::to_string

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

    RefreshKind

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

    impl Show for RefreshKind

    RefreshKind::cpu

    RefreshKind::equal

    fn RefreshKind::equal(RefreshKind, RefreshKind) -> Bool

    RefreshKind::everything

    fn RefreshKind::everything() -> RefreshKind

    RefreshKind::memory

    RefreshKind::not_equal

    fn RefreshKind::not_equal(x : RefreshKind, y : RefreshKind) -> Bool

    RefreshKind::nothing

    fn RefreshKind::nothing() -> RefreshKind

    RefreshKind::output

    fn RefreshKind::output(self : RefreshKind, logger : &Logger) -> Unit

    RefreshKind::processes

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

    RefreshKind::to_string

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

    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
    } derive(Eq,
    Debug
    )

    impl Show for Signal

    Signal::equal

    fn Signal::equal(Signal, Signal) -> Bool

    Signal::not_equal

    fn Signal::not_equal(x : Signal, y : Signal) -> Bool

    Signal::output

    fn Signal::output(self : Signal, logger : &Logger) -> Unit

    Signal::to_repr

    Signal::to_string

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

    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
    } derive(Eq,
    Debug
    )

    impl Show for ThreadKind

    ThreadKind::equal

    fn ThreadKind::equal(ThreadKind, ThreadKind) -> Bool

    ThreadKind::not_equal

    fn ThreadKind::not_equal(x : ThreadKind, y : ThreadKind) -> Bool

    ThreadKind::output

    fn ThreadKind::output(self : ThreadKind, logger : &Logger) -> Unit

    ThreadKind::to_string

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

    Uid

    pub(all) struct Uid {
    value : Int
    } derive(Compare, Eq, Hash,
    Debug
    )

    impl Show for Uid

    Uid::compare

    fn Uid::compare(Uid, Uid) -> Int

    Uid::equal

    fn Uid::equal(Uid, Uid) -> Bool

    Uid::from

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

    Uid::hash

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

    Uid::hash_combine

    fn Uid::hash_combine(Uid, Hasher) -> Unit

    Uid::not_equal

    fn Uid::not_equal(x : Uid, y : Uid) -> Bool

    Uid::op_ge

    fn Uid::op_ge(x : Uid, y : Uid) -> Bool

    Uid::op_gt

    fn Uid::op_gt(x : Uid, y : Uid) -> Bool

    Uid::op_le

    fn Uid::op_le(x : Uid, y : Uid) -> Bool

    Uid::op_lt

    fn Uid::op_lt(x : Uid, y : Uid) -> Bool

    Uid::output

    fn Uid::output(self : Uid, logger : &Logger) -> Unit

    Uid::to_int

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

    Uid::to_repr

    Uid::to_string

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

    UpdateKind

    pub(all) enum UpdateKind {
    Never
    Always
    OnlyIfNotSet
    } derive(Eq,
    Debug
    )

    impl Show for UpdateKind

    UpdateKind::equal

    fn UpdateKind::equal(UpdateKind, UpdateKind) -> Bool

    UpdateKind::not_equal

    fn UpdateKind::not_equal(x : UpdateKind, y : UpdateKind) -> Bool

    UpdateKind::output

    fn UpdateKind::output(self : UpdateKind, logger : &Logger) -> Unit

    UpdateKind::to_string

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

    User

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

    impl Show for User

    User::equal

    fn User::equal(User, User) -> Bool

    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

    User::not_equal

    fn User::not_equal(x : User, y : User) -> Bool

    User::output

    fn User::output(self : User, logger : &Logger) -> Unit

    User::to_repr

    User::to_string

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

    Users

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

    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::output

    fn Users::output(self : Users, logger : &Logger) -> Unit

    Users::refresh

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

    Users::to_repr

    Users::to_string

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

    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]