Documentation ¶
Overview ¶
SPDX-License-Identifier: BSD-3-Clause
Index ¶
- Constants
- func Counts(logical bool) (int, error)
- func CountsWithContext(ctx context.Context, logical bool) (int, error)
- func Percent(interval time.Duration, percpu bool) ([]float64, error)
- func PercentWithContext(ctx context.Context, interval time.Duration, percpu bool) ([]float64, error)
- type InfoStat
- type TimesStat
Constants ¶
View Source
const (
ClocksPerSec = 10000000.0
)
Variables ¶
This section is empty.
Functions ¶
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"` Microcode string `json:"microcode"` }
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"` }
TimesStat contains the amounts of time the CPU has spent performing different kinds of work. Time units are in seconds. It is based on linux /proc/stat file.
func TimesWithContext ¶
Click to show internal directories.
Click to hide internal directories.