memory

package
v6.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMemPercentage

func AddMemPercentage(m *MemStat)

AddMemPercentage calculates the ratio of used and total size of memory

func AddSwapPercentage

func AddSwapPercentage(s *SwapStat)

AddSwapPercentage calculates the ratio of used and total swap size

func GetMemoryEvent

func GetMemoryEvent(memStat *MemStat) common.MapStr

GetMemoryEvent returns the event created from memory statistics

func GetSwapEvent

func GetSwapEvent(swapStat *SwapStat) common.MapStr

GetSwapEvent returns the event created from swap usage

Types

type MemStat

type MemStat struct {
	sigar.Mem
	UsedPercent       float64 `json:"used_p"`
	ActualUsedPercent float64 `json:"actual_used_p"`
}

MemStat includes the memory usage statistics and ratios of usage and total memory usage

func Get

func Get() (*MemStat, error)

Get returns the memory stats of the host

type SwapStat

type SwapStat struct {
	sigar.Swap
	UsedPercent float64 `json:"used_p"`
}

SwapStat includes the current swap usage and the ratio of used and total swap size

func GetSwap

func GetSwap() (*SwapStat, error)

GetSwap returns the swap usage of the host

Jump to

Keyboard shortcuts

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