memory

package
v6.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package memory collects memory metrics from the host OS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMemPercentage

func AddMemPercentage(m *MemStat)

func AddSwapPercentage

func AddSwapPercentage(s *SwapStat)

func GetMemoryEvent

func GetMemoryEvent(memStat *MemStat) common.MapStr

func GetSwapEvent

func GetSwapEvent(swapStat *SwapStat) common.MapStr

func New

func New(base mb.BaseMetricSet) (mb.MetricSet, error)

New is a mb.MetricSetFactory that returns a memory.MetricSet.

Types

type MemStat

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

func GetMemory

func GetMemory() (*MemStat, error)

type MetricSet

type MetricSet struct {
	mb.BaseMetricSet
}

MetricSet for fetching system memory metrics.

func (*MetricSet) Fetch

func (m *MetricSet) Fetch() (event common.MapStr, err error)

Fetch fetches memory metrics from the OS.

type SwapStat

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

func GetSwap

func GetSwap() (*SwapStat, error)

Jump to

Keyboard shortcuts

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