psutil._psosx

macOS platform implementation.

Module Contents

__extra__all__ = []
PAGESIZE
TCP_STATUSES
PROC_STATUSES
kinfo_proc_map
pidtaskinfo_map
NoSuchProcess
ZombieProcess
AccessDenied
TimeoutExpired
scputimes
svmem
pmem
pfullmem
virtual_memory()

System virtual memory as a namedtuple.

swap_memory()

Swap system memory as a (total, used, free, sin, sout) tuple.

cpu_times()

Return system CPU times as a namedtuple.

per_cpu_times()

Return system CPU times as a named tuple

cpu_count_logical()

Return the number of logical CPUs in the system.

cpu_count_physical()

Return the number of physical CPUs in the system.

cpu_stats()
cpu_freq()

Return CPU frequency. On macOS per-cpu frequency is not supported. Also, the returned frequency never changes, see: https://arstechnica.com/civis/viewtopic.php?f=19&t=465002

disk_usage
disk_io_counters
disk_partitions(all=False)

Return mounted disk partitions as a list of namedtuples.

sensors_battery()

Return battery information.

net_io_counters
net_if_addrs
net_connections(kind='inet')

System-wide network connections.

net_if_stats()

Get NIC stats (isup, duplex, speed, mtu).

boot_time()

The system boot time expressed in seconds since the epoch.

users()

Return currently connected users as a list of namedtuples.

pids()
pid_exists
wrap_exceptions(fun)

Decorator which translates bare OSError exceptions into NoSuchProcess and AccessDenied.

catch_zombie(proc)

There are some poor C APIs which incorrectly raise ESRCH when the process is still alive or it’s a zombie, or even RuntimeError (those who don’t set errno). This is here in order to solve: https://github.com/giampaolo/psutil/issues/1044

class Process(pid)

Bases:object

Wrapper class around underlying C implementation.

__slots__ = ['pid', '_name', '_ppid', '_cache']
_get_kinfo_proc(self)
_get_pidtaskinfo(self)
oneshot_enter(self)
oneshot_exit(self)
name(self)
exe(self)
cmdline(self)
environ(self)
ppid(self)
cwd(self)
uids(self)
gids(self)
terminal(self)
memory_info(self)
memory_full_info(self)
cpu_times(self)
create_time(self)
num_ctx_switches(self)
num_threads(self)
open_files(self)
connections(self, kind='inet')
num_fds(self)
wait(self, timeout=None)
nice_get(self)
nice_set(self, value)
status(self)
threads(self)