psutil

package
v0.0.0-...-08eec21 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package psutil Date: 2024/06/10 18:58:51 Author: Amu Description:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCPUPercent

func GetCPUPercent() (float64, error)

func GetDiskIO

func GetDiskIO(devices map[string]struct{}) (map[string]DiskIO, error)

func GetDiskInfo

func GetDiskInfo(devices map[string]struct{}) (map[string]DiskInfo, error)

func GetMemInfo

func GetMemInfo() (float64, uint64, uint64, error)

func GetNetworkIO

func GetNetworkIO(eth map[string]struct{}) (map[string]NetIO, error)

Types

type DiskIO

type DiskIO struct {
	Read  uint64 `json:"read"`
	Write uint64 `json:"write"`
}

type DiskInfo

type DiskInfo struct {
	Total   uint64
	Percent float64
	Used    uint64
}

type NetIO

type NetIO struct {
	Recv uint64 `json:"recv"`
	Send uint64 `json:"send"`
}

type SystemInfo

type SystemInfo struct {
	Uptime          string
	Hostname        string
	Os              string
	Platform        string
	PlatformVersion string
	KernelVersion   string
	KernelArch      string
}

func GetSystemInfo

func GetSystemInfo() (*SystemInfo, error)

GetSystemInfo 获取系统信息

Jump to

Keyboard shortcuts

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