cpu

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUInfo

type CPUInfo struct {
	ModelName string  `json:"modelName"`
	Cores     int32   `json:"cores"`
	Frequency float64 `json:"frequency"` // cpu频率,单位(Mhz)
}

CPUInfo cpu info

type Process

type Process struct {
	UsagePercent float64 `json:"usage_percent"` // cpu使用率,单位(%)

	RSS uint64 `json:"rss"` // 使用物理内存,单位(M)
	VMS uint64 `json:"vms"` // 使用虚拟内存,单位(M)
}

Process 进程的cpu使用率

func GetProcess

func GetProcess() *Process

GetProcess get current process info

type System

type System struct {
	UsagePercent float64   `json:"usage_percent"` // cpu使用率,单位(%)
	CPUInfo      []CPUInfo `json:"cpu_info"`
}

System 系统CPU信息

func GetSystemCPU

func GetSystemCPU() *System

GetSystemCPU get system cpu info

Jump to

Keyboard shortcuts

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