package cpu
import "github.com/shirou/gopsutil/cpu"
Index ¶
- func Counts(logical bool) (int, error)
- func Percent(interval time.Duration, percpu bool) ([]float64, error)
- type InfoStat
- type TimesStat
- func Times(percpu bool) ([]TimesStat, error)
- func (c TimesStat) String() string
- func (c TimesStat) Total() float64
- type Win32_Processor
Functions ¶
func Counts ¶
func Percent ¶
Percent calculates the percentage of cpu used either per CPU or combined. If an interval of 0 is given it will compare the current cpu times against the last call.
Types ¶
type InfoStat ¶
type InfoStat struct { CPU int32 `json:"cpu"` VendorID string `json:"vendorId"` Family string `json:"family"` Model string `json:"model"` Stepping int32 `json:"stepping"` PhysicalID string `json:"physicalId"` CoreID string `json:"coreId"` Cores int32 `json:"cores"` ModelName string `json:"modelName"` Mhz float64 `json:"mhz"` CacheSize int32 `json:"cacheSize"` Flags []string `json:"flags"` }
func Info ¶
func (InfoStat) String ¶
type TimesStat ¶
type TimesStat struct { CPU string `json:"cpu"` User float64 `json:"user"` System float64 `json:"system"` Idle float64 `json:"idle"` Nice float64 `json:"nice"` Iowait float64 `json:"iowait"` Irq float64 `json:"irq"` Softirq float64 `json:"softirq"` Steal float64 `json:"steal"` Guest float64 `json:"guest"` GuestNice float64 `json:"guestNice"` Stolen float64 `json:"stolen"` }
func Times ¶
TODO: Get percpu
func (TimesStat) String ¶
func (TimesStat) Total ¶
Total returns the total number of seconds in a CPUTimesStat
type Win32_Processor ¶
type Win32_Processor struct { LoadPercentage *uint16 Family uint16 Manufacturer string Name string NumberOfLogicalProcessors uint32 ProcessorID *string Stepping *string MaxClockSpeed uint32 }
Source Files ¶
- Version
- v2.16.12+incompatible
- Published
- Dec 24, 2016
- Platform
- windows/amd64
- Imports
- 11 packages
- Last checked
- 5 hours ago –
Tools for package owners.