memory

package
v5.3.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2017 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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