monitor

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SYSTEM     string = "system"
	MEMORY     string = "memory"
	SWAP       string = "swap"
	PROC_USAGE string = "procUsage"
	PROCESSES  string = "processes"
	DISKS      string = "disks"
	SERVICES   string = "services"
	NETWORKS   string = "networks"
)

Variables

This section is empty.

Functions

func GetDisks

func GetDisks(syStats *systats.SyStats, config *config.Config) []systats.Disk

GetDisks returns array of systats.Disk structs with disk info and usage data

func GetMemory

func GetMemory(syStats *systats.SyStats) systats.Memory

GetMemory returns systats.Memory struct with memory usage

func GetNetwork

func GetNetwork(syStats *systats.SyStats) []systats.Network

GetNetwork returns an array of systats.Network struct with network usage

func GetProcessor

func GetProcessor(syStats *systats.SyStats) systats.CPU

GetProcessor returns a systats.CPU struct with CPU info and usage data

func GetSwap

func GetSwap(syStats *systats.SyStats) systats.Swap

GetSwap returns systats.Swap struct with swap usage

func GetSystem

func GetSystem(syStats *systats.SyStats) systats.System

GetSystem returns a systats.System struct with system info

func MonitorAsJSON

func MonitorAsJSON(config *config.Config) string

MonitorAsJSON returns MonitorData struct as an JSON object

Types

type CustomMetric

type CustomMetric struct {
	Name     string
	Unit     string
	Value    string
	ServerId string
	Time     string
}

type MonitorData

type MonitorData struct {
	UnixTime  string
	System    systats.System
	Memory    systats.Memory
	Swap      systats.Swap
	Disk      []systats.Disk
	ProcUsage systats.CPU
	Networks  []systats.Network
	Processes Processes
	Services  []Service
	ServerId  string
}

MonitorData holds individual system stats

func Monitor

func Monitor(config *config.Config) MonitorData

Monitor returns MonitorData struct with system stats

type Processes added in v1.1.1

type Processes struct {
	CPU    []systats.Process
	Memory []systats.Process
}

Processes hold CPU and Memory usage data

func GetProcesses added in v0.0.10

func GetProcesses(syStats *systats.SyStats) Processes

GetProcesses returns struct with process info

type Service

type Service struct {
	Name    string
	Running bool
	Time    string
}

Service holds service activity info

func GetServices

func GetServices(syStats *systats.SyStats, unixTime string, config *config.Config) []Service

GetServices returns array of Service structs with service status

Jump to

Keyboard shortcuts

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