psutil

package
v0.0.0-...-31c1c1e Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CPUCounts

func CPUCounts(logical bool) (float64, error)

func DiskUsage

func DiskUsage(path string) (*disk.UsageStat, error)

func NetIOCounters

func NetIOCounters(pernic bool) ([]net.IOCountersStat, error)

Types

type CPUInfoStat

type CPUInfoStat struct {
	System float64
	User   float64
	Idle   float64
	Other  float64
}

func CPUPercent

func CPUPercent() (*CPUInfoStat, error)

type MemoryInfoStat

type MemoryInfoStat struct {
	Total     uint64
	Available uint64
	Used      uint64
}

func VirtualMemory

func VirtualMemory() (*MemoryInfoStat, error)

type Process

type Process interface {
	CPUPercent() (*CPUInfoStat, error)
	VirtualMemory() (uint64, error)
	Stop()
}

func NewProcess

func NewProcess(pid int32) (Process, error)

type Util

type Util interface {
	Start()
	Stop()
	CPUCounts(logical bool) (float64, error)
	CPUPercent() (*CPUInfoStat, error)
	DiskUsage(path string) (*disk.UsageStat, error)
	VirtualMemory() (*MemoryInfoStat, error)
	NetIOCounters(pernic bool) ([]net.IOCountersStat, error)
	Process(pid int32) (Process, error)
}
var DefaultUtil Util

func New

func New(root string) (Util, error)

New returns a new util, it will be started automatically

Jump to

Keyboard shortcuts

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