memory

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: Apache-2.0 Imports: 3 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

This section is empty.

Types

type MemoryInfo

type MemoryInfo struct {
	Total     uint64  `json:"total"`     //总共内存(MB)
	Available uint64  `json:"available"` //实际可用内存(MB)
	Used      uint64  `json:"used"`      //已用内存(MB)
	Free      uint64  `json:"free"`      //剩余内存(MB)
	Percent   float64 `json:"percent"`   //使用率
	LastTime  string  `json:"lastTime"`  //采集时间
}

func GetMemoryInfo

func GetMemoryInfo() *MemoryInfo

func NewMemoryInfo

func NewMemoryInfo() *MemoryInfo

创建内存信息对象

func (MemoryInfo) String

func (o MemoryInfo) String() string

Jump to

Keyboard shortcuts

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