package cpu

Import Path
	github.com/gofiber/fiber/v2/internal/gopsutil/cpu (on go.dev)

Dependency Relation
	imports 12 packages, and imported by 2 packages

Involved Source Files cpu.go cpu_linux.go
Package-Level Type Names (total 2)
/* sort by: | */
CPU int32 CacheSize int32 CoreID string Cores int32 Family string Flags []string Mhz float64 Microcode string Model string ModelName string PhysicalID string Stepping int32 VendorID string ( InfoStat) String() string InfoStat : github.com/ChrisTrenkamp/goxpath/tree.Result InfoStat : fmt.Stringer func Info() ([]InfoStat, error) func InfoWithContext(ctx context.Context) ([]InfoStat, error)
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. CPU string Guest float64 GuestNice float64 Idle float64 Iowait float64 Irq float64 Nice float64 Softirq float64 Steal float64 System float64 User float64 ( TimesStat) String() string Total returns the total number of seconds in a CPUTimesStat TimesStat : github.com/ChrisTrenkamp/goxpath/tree.Result TimesStat : fmt.Stringer func Times(percpu bool) ([]TimesStat, error) func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) func github.com/gofiber/fiber/v2/internal/gopsutil/process.(*Process).Threads() (map[int32]*TimesStat, error) func github.com/gofiber/fiber/v2/internal/gopsutil/process.(*Process).ThreadsWithContext(ctx context.Context) (map[int32]*TimesStat, error) func github.com/gofiber/fiber/v2/internal/gopsutil/process.(*Process).Times() (*TimesStat, error) func github.com/gofiber/fiber/v2/internal/gopsutil/process.(*Process).TimesWithContext(ctx context.Context) (*TimesStat, error)
Package-Level Functions (total 8)
Counts returns the number of physical or logical cores in the system
CPUInfo on linux will return 1 item per physical thread. CPUs have three levels of counting: sockets, cores, threads. Cores with HyperThreading count as having 2 threads per core. Sockets often come with many physical CPU cores. For example a single socket board with two cores each with HT will return 4 CPUInfoStat structs on Linux and the "Cores" field set to 1.
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. Returns one value per cpu, or a single value if percpu is set to false.
func PercentWithContext(ctx context.Context, interval time.Duration, percpu bool) ([]float64, error)
func Times(percpu bool) ([]TimesStat, error)
Package-Level Variables (only one)