machine

package
v1.1.2-pre Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var M = newMachineInfo()

Functions

func GetCpuInfo

func GetCpuInfo() map[string]string

字段名 含义 cpu_proc cpu核数 cpu_percent cpu使用率

func GetDiskInfo

func GetDiskInfo() map[string]string

默认路径为:/(win10下如果硬盘分区,则为所在硬盘的根目录) 字段名 含义 disk_used 硬盘已使用 disk_free 硬盘可用 disk_total 硬盘总大小 disk_used_percent 硬盘使用率(三位小数)

func GetMemInfo

func GetMemInfo() map[string]string

字段名 含义 mem_free 内存可用 mem_total 内存总大小 mem_used_percent 内存使用率(三位小数)

Types

type CpuMonitor

type CpuMonitor struct {
	chain.BaseHandler
	sync.RWMutex // 保证percent的并发安全
	// contains filtered or unexported fields
}

func NewCpuMonitor

func NewCpuMonitor() *CpuMonitor

func (*CpuMonitor) MonitorUsePercent

func (c *CpuMonitor) MonitorUsePercent()

type DiskMonitor

type DiskMonitor struct {
	chain.BaseHandler
}

func NewDiskMonitor

func NewDiskMonitor() *DiskMonitor

type GetMachineFunc

type GetMachineFunc func(map[string]string) error

type Machine

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

func NewMachine

func NewMachine() *Machine

func (*Machine) GetMachineInfo

func (machine *Machine) GetMachineInfo(code byte) map[string]string

type MemMonitor

type MemMonitor struct {
	chain.BaseHandler
}

func NewMemMonitor

func NewMemMonitor() *MemMonitor

Jump to

Keyboard shortcuts

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