agent

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUTicks

type CPUTicks struct {
	// contains filtered or unexported fields
}

------------------------------------------------------------------------------

type Interface

type Interface struct {
	Name  string  `json:"name"`
	IP    string  `json:"ip"`
	ExtIP string  `json:"extIP"`
	Up    float64 `json:"up"`
	Down  float64 `json:"down"`
}

type Metrics

type Metrics struct {
	Hostname string  `json:"hostname"`
	Uptime   float64 `json:"uptime"`
	CPU      struct {
		CPU  float64    `json:"cpu"`
		CPUs []float64  `json:"cpus"`
		Top  [5]Process `json:"top"`
	} `json:"cpu"`
	Memory struct {
		Total uint64     `json:"total"`
		Avail uint64     `json:"avail"`
		Top   [5]Process `json:"top"`
	} `json:"memory"`
	Swap struct {
		Total uint64 `json:"total"`
		Free  uint64 `json:"free"`
	} `json:"swap"`
	Filesystems []Partition `json:"filesystems"`
	Networks    []Interface `json:"networks"`
}

==============================================================================

func (*Metrics) GetCPU

func (self *Metrics) GetCPU()

func (*Metrics) GetFilesystems

func (self *Metrics) GetFilesystems(partitions []string)

------------------------------------------------------------------------------

func (*Metrics) GetHostname

func (self *Metrics) GetHostname()

------------------------------------------------------------------------------

func (*Metrics) GetMemory

func (self *Metrics) GetMemory()

------------------------------------------------------------------------------

func (*Metrics) GetNetworks

func (self *Metrics) GetNetworks(interfaces []string)

------------------------------------------------------------------------------

func (*Metrics) GetUptime

func (self *Metrics) GetUptime()

------------------------------------------------------------------------------

type Partition

type Partition struct {
	Name  string `json:"name"`
	Total uint64 `json:"total"`
	Used  uint64 `json:"used"`
	Avail uint64 `json:"avail"`
}

type Process

type Process struct {
	Pid  string `json:"pid"`
	Cmd  string `json:"cmd"`
	Perc string `json:"perc"`
}

Jump to

Keyboard shortcuts

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