385#define sysCPUSamplerInit(s) memset((s), 0, sizeof(SysCPUSampler))
523#define procCPUSamplerInit(s) memset((s), 0, sizeof(ProcCPUSampler))
int64 ProcessID
Operating system process id.
bool sysCPUSample(SysCPUSampler *s, float64 *pct)
float64 sysCPUUsage(const SysCPUTimes *first, const SysCPUTimes *second)
bool procIOInfoByID(ProcIOInfo *out, ProcessID pid)
bool procCPUTimesByID(ProcCPUTimes *out, ProcessID pid)
bool procCPUSample(ProcCPUSampler *s, Process *proc, float64 *pct)
ProcCPUTimesValid
Which fields of a ProcCPUTimes the operating system reported.
SysMemInfoValid
Which fields of a SysMemInfo the operating system reported.
SysUptimeValid
Which fields of a SysUptime the operating system reported.
SysCPUTimesValid
Which breakdown fields of a SysCPUTimes the operating system reported.
float64 procCPUUsage(const ProcCPUTimes *first, const ProcCPUTimes *second)
bool sysCPUTimes(SysCPUTimes *out)
bool sysLoadAvg(SysLoadAvg *out)
bool procMemInfo(ProcMemInfo *out, Process *proc)
bool procMemInfoByID(ProcMemInfo *out, ProcessID pid)
bool procIOInfo(ProcIOInfo *out, Process *proc)
bool sysUptime(SysUptime *out)
SysLoadAvgValid
Which fields of a SysLoadAvg the operating system reported.
bool procCPUTimes(ProcCPUTimes *out, Process *proc)
ProcMemInfoValid
Which fields of a ProcMemInfo the operating system reported.
ProcIOInfoValid
Which fields of a ProcIOInfo the operating system reported.
bool sysMemInfo(SysMemInfo *out)
@ SYSMEM_PageSize
pageSize
@ SYSMEM_Phys
physTotal and physAvail
@ SYSMEM_Commit
commitTotal and commitAvail
@ SYSMEM_Swap
swapTotal and swapAvail
@ PROCMEM_Virtual
virtualSize
@ PROCMEM_PeakVirtual
peakVirtualSize
@ PROCMEM_Resident
resident
@ PROCMEM_PeakResident
peakResident
@ PROCMEM_Private
privateSize
@ PROCIO_Ops
readOps and writeOps
@ PROCIO_Other
otherBytes and otherOps
@ PROCIO_Bytes
readBytes and writeBytes
Launching, inspecting and controlling operating system processes.
ProcCPUTimes last
The previous reading.
bool primed
Whether a previous reading has been taken yet.
Processor time one process has used since it started.
flags_t valid
ProcCPUTimesValid flags naming the fields that were reported.
int64 sampled
When the reading was taken, from clockTimer()
int64 user
Microseconds spent running the program's own code.
int64 started
When the process started, as a cx time value.
int64 system
Microseconds spent inside the operating system on its behalf.
int64 total
Microseconds of processor time used altogether: user plus system.
uint64 otherOps
How many such operations were made. Windows only.
flags_t valid
ProcIOInfoValid flags naming the fields that were reported.
uint64 readBytes
Bytes read. Not reported on FreeBSD.
uint64 otherBytes
Bytes transferred by anything that is neither. Windows only.
uint64 writeOps
How many separate writes were made.
uint64 writeBytes
Bytes written. Not reported on FreeBSD.
uint64 readOps
How many separate reads were made.
How much memory one process is using.
uint64 privateSize
Bytes of memory the process has asked for and nobody else can share.
uint64 virtualSize
Bytes of address space the process has reserved.
uint64 peakVirtualSize
The largest that has ever been. Linux only.
uint64 peakResident
The largest that has ever been.
uint64 swapped
Bytes of the process paged out to swap. Linux only.
uint64 resident
Bytes of the process currently held in memory.
flags_t valid
ProcMemInfoValid flags naming the fields that were reported.
Remembers the previous reading so repeated polling needs only one call each time.
bool primed
Whether a previous reading has been taken yet.
SysCPUTimes last
The previous reading.
int64 busy
Time accounted for as anything other than idle.
int64 irq
Time spent servicing hardware. Not reported on Windows.
int64 user
Time spent running program code, including at low priority.
int64 sampled
When the reading was taken, from clockTimer()
int64 system
Time spent inside the operating system.
int64 total
Time accounted for altogether: busy plus idle.
int32 cpus
How many logical processors these figures cover.
int64 steal
Time a hypervisor gave to someone else. Linux only.
int64 idle
Time spent with nothing to do.
flags_t valid
SysCPUTimesValid flags naming the breakdown fields that were reported.
int64 iowait
Time spent waiting for a disk. Linux only.
float64 load1
Average over the last minute.
flags_t valid
SysLoadAvgValid flags naming the fields that were reported.
float64 load5
Average over the last five minutes.
float64 load15
Average over the last fifteen minutes.
How much memory the machine has and how much of it is spoken for.
flags_t valid
SysMemInfoValid flags naming the fields that were reported.
uint64 commitAvail
Bytes of that promise not yet handed out.
uint64 commitTotal
Bytes of memory the system is willing to promise to programs in total.
uint64 pageSize
Size of a memory page in bytes.
uint64 swapAvail
Bytes of swap space still free.
uint64 physTotal
Bytes of memory installed in the machine.
uint64 physAvail
Bytes that can be used without paging something out first.
uint64 swapTotal
Bytes of swap space configured.
How long the machine has been running.
int64 uptime
Microseconds since the machine booted.
int64 boottime
When the machine booted, as a cx time value.
flags_t valid
SysUptimeValid flags naming the fields that were reported.