Skip to content

MacOS Support #16

@Anupal

Description

@Anupal

MacOS doesn't follow Linux style mapping of files to system information. But we do have useful CLI commands.

The main command I found for this is sysctl and sysctl -a gives all system information.
Specific commands

// total memory size
$ sysctl hw.memsize

// cpu info
$ sysctl hw.ncpu

$ sysctl vm.loadavg
vm.loadavg: { 1.31 1.85 2.00 }

RAM usage can be parsed using top -l 1. It pretty much gives us everything in single snapshot, but I am not sure about regex.
Also top commands seems to be slow, vm_stat is better option for RAM. The values will need to be computed.

Also Mac has a concept of Wired Memory. Need to read a bit about it.

Battery info can be fetched using pmset -g batt

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions