beater

package
v0.0.0-...-320d922 Latest Latest
Warning

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

Go to latest
Published: May 10, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFileSystemList

func GetFileSystemList() ([]sigar.FileSystem, error)

func Pids

func Pids() ([]int, error)

func Round

func Round(val float64, roundOn float64, places int) (newVal float64)

Types

type ConfigSettings

type ConfigSettings struct {
	Input TopConfig
}

type CpuTimes

type CpuTimes struct {
	sigar.Cpu
	UserPercent   float64 `json:"user_p"`
	SystemPercent float64 `json:"system_p"`
}

func GetCpuTimes

func GetCpuTimes() (*CpuTimes, error)

func GetCpuTimesList

func GetCpuTimesList() ([]CpuTimes, error)

type FileSystemStat

type FileSystemStat struct {
	sigar.FileSystemUsage
	DevName     string  `json:"device_name"`
	Mount       string  `json:"mount_point"`
	UsedPercent float64 `json:"used_p"`
	// contains filtered or unexported fields
}

func GetFileSystemStat

func GetFileSystemStat(fs sigar.FileSystem) (*FileSystemStat, error)

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 Process

type Process struct {
	Pid      int    `json:"pid"`
	Ppid     int    `json:"ppid"`
	Name     string `json:"name"`
	Username string `json:"username"`
	State    string `json:"state"`
	CmdLine  string `json:"cmdline"`
	Mem      sigar.ProcMem
	Cpu      sigar.ProcTime
	// contains filtered or unexported fields
}

func GetProcess

func GetProcess(pid int, cmdline string) (*Process, error)

type ProcsMap

type ProcsMap map[int]*Process

type SwapStat

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

func GetSwap

func GetSwap() (*SwapStat, error)

type SystemLoad

type SystemLoad struct {
	Load1  float64 `json:"load1"`
	Load5  float64 `json:"load5"`
	Load15 float64 `json:"load15"`
}

func GetSystemLoad

func GetSystemLoad() (*SystemLoad, error)

type TopConfig

type TopConfig struct {
	Period *int64
	Procs  *[]string
	Stats  struct {
		System     *bool `config:"system"`
		Proc       *bool `config:"process"`
		Filesystem *bool `config:"filesystem"`
		CpuPerCore *bool `config:"cpu_per_core"`
	}
}

type Topbeat

type Topbeat struct {
	TbConfig ConfigSettings
	// contains filtered or unexported fields
}

func New

func New() *Topbeat

func (*Topbeat) Cleanup

func (tb *Topbeat) Cleanup(b *beat.Beat) error

func (*Topbeat) Config

func (tb *Topbeat) Config(b *beat.Beat) error

func (*Topbeat) MatchProcess

func (t *Topbeat) MatchProcess(name string) bool

func (*Topbeat) Run

func (t *Topbeat) Run(b *beat.Beat) error

func (*Topbeat) Setup

func (tb *Topbeat) Setup(b *beat.Beat) error

func (*Topbeat) Stop

func (t *Topbeat) Stop()

Jump to

Keyboard shortcuts

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