xruntime

package
v0.0.0-...-01d4da0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MulanPSL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	B  = 1
	KB = 1024 * B
	MB = 1024 * KB
	GB = 1024 * MB
)

Variables

This section is empty.

Functions

func ProcessMemMB

func ProcessMemMB() uint64

ProcessMemMB 进程内存

Types

type Cpu

type Cpu struct {
	Cpus  []float64 `json:"cpus"`
	Cores int       `json:"cores"`
}

func GetCPU

func GetCPU() (c Cpu, err error)

type Disk

type Disk struct {
	UsedMB  int `json:"usedMb"`
	UsedGB  int `json:"usedGb"`
	TotalMB int `json:"totalMb"`
	TotalGB int `json:"totalGb"`
}

func GetDisk

func GetDisk() (d Disk, err error)

type Os

type Os struct {
	GOOS      string `json:"goos"`
	NumCPU    int    `json:"numCpu"`
	Compiler  string `json:"compiler"`
	GoVersion string `json:"goVersion"`
}

func GetOS

func GetOS() (o Os)

type Ram

type Ram struct {
	UsedMB  int `json:"usedMb"`
	TotalMB int `json:"totalMb"`
}

func GetRAM

func GetRAM() (r Ram, err error)

type Server

type Server struct {
	Os   Os   `json:"os"`
	Cpu  Cpu  `json:"cpu"`
	Ram  Ram  `json:"ram"`
	Disk Disk `json:"disk"`
}

Jump to

Keyboard shortcuts

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