Documentation ¶
Overview ¶
Package cpu is a library that counts system and process cpu usage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPUInfo ¶
type CPUInfo struct { ModelName string `json:"modelName"` Cores int32 `json:"cores"` Frequency float64 `json:"frequency"` // cpu frequency, unit(Mhz) }
CPUInfo cpu information
type Process ¶
type Process struct { UsagePercent float64 `json:"usage_percent"` // cpu usage, unit(%), current process occupies current logical CPU, total usage is cores*UsagePercent RSS uint64 `json:"rss"` // use of physical memory, unit(M) VMS uint64 `json:"vms"` // use of virtual memory, unit(M) }
Process information
Click to show internal directories.
Click to hide internal directories.