cpu

package
v1.1.0-beta.0...-70f5218 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCPUCount

func GetCPUCount() int

GetCPUCount returns the number of logical CPUs usable by the current process.

func GetCPUUsage

func GetCPUUsage() (float64, bool)

GetCPUUsage returns the cpu usage of the current process.

Types

type Observer

type Observer struct {
	// contains filtered or unexported fields
}

Observer is used to observe the cpu usage of the current process.

func NewCPUObserver

func NewCPUObserver() *Observer

NewCPUObserver returns a cpu observer.

func (*Observer) Start

func (c *Observer) Start()

Start starts the cpu observer.

func (*Observer) Stop

func (c *Observer) Stop()

Stop stops the cpu observer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL