host

package
v0.0.0-...-35a33d0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearOldMetrics

func ClearOldMetrics()

ClearOldMetrics will delete any metric that is older than 6 hours

func StartHostPoller

func StartHostPoller()

StartHostPoller will refresh the cache for host details

Types

type Info

type Info struct {
	Host       *host.InfoStat         `json:"host"`
	Processors []cpu.InfoStat         `json:"processors"`
	Memory     *mem.VirtualMemoryStat `json:"memory"`
	Load       *load.AvgStat          `json:"load"`
}

Info contains all host resource information

var HostInfo Info

HostInfo is a collection of information about the host and it's resources

func GetHostInfo

func GetHostInfo() Info

GetHostInfo returns a struct of host information

func GetInfo

func GetInfo(refresh bool) Info

GetInfo will return the pre populated Info struct. If refresh True is sent it will refresh the cache first.

type Metric

type Metric struct {
	Created       time.Time `json:"created"`
	Load          float64   `json:"load"`
	MemoryUsed    uint64    `json:"memoryUsed"`
	MemoryPercent float64   `json:"memoryPercent"`
}

Metric represents a single instance in time of system info

func GetHostMetrics

func GetHostMetrics(count int, direction string) (m []Metric)

GetHostMetrics return slice of metrics based on given start and end time

func GetHostMetricsByTime

func GetHostMetricsByTime(startTime interface{}, endTime interface{}) (m []Metric)

GetHostMetricsByTime return slice of metrics based on given start and end time

Jump to

Keyboard shortcuts

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