beat

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2016 License: Apache-2.0 Imports: 12 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 {
	User          uint64  `json:"user"`
	UserPercent   float64 `json:"user_p"`
	Nice          uint64  `json:"nice"`
	System        uint64  `json:"system"`
	SystemPercent float64 `json:"system_p"`
	Idle          uint64  `json:"idle"`
	IOWait        uint64  `json:"iowait"`
	Irq           uint64  `json:"irq"`
	SoftIrq       uint64  `json:"softirq"`
	Steal         uint64  `json:"steal"`
}

func GetCpuTimes

func GetCpuTimes() (*CpuTimes, error)

func GetCpuTimesList

func GetCpuTimesList() ([]CpuTimes, error)

func (*CpuTimes) String

func (t *CpuTimes) String() string

type FileSystemStat

type FileSystemStat struct {
	DevName     string  `json:"device_name"`
	Total       uint64  `json:"total"`
	Used        uint64  `json:"used"`
	UsedPercent float64 `json:"used_p"`
	Free        uint64  `json:"free"`
	Avail       uint64  `json:"avail"`
	Files       uint64  `json:"files"`
	FreeFiles   uint64  `json:"free_files"`
	Mount       string  `json:"mount_point"`
	// contains filtered or unexported fields
}

func GetFileSystemStat

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

func (*FileSystemStat) String

func (f *FileSystemStat) String() string

type MemStat

type MemStat struct {
	Total             uint64  `json:"total"`
	Used              uint64  `json:"used"`
	Free              uint64  `json:"free"`
	UsedPercent       float64 `json:"used_p"`
	ActualUsed        uint64  `json:"actual_used"`
	ActualFree        uint64  `json:"actual_free"`
	ActualUsedPercent float64 `json:"actual_used_p"`
}

func GetMemory

func GetMemory() (*MemStat, error)

func (*MemStat) String

func (m *MemStat) String() string

type ProcCpuTime

type ProcCpuTime struct {
	User        uint64  `json:"user"`
	UserPercent float64 `json:"user_p"`
	System      uint64  `json:"system"`
	Total       uint64  `json:"total"`
	Start       string  `json:"start_time"`
}

func (*ProcCpuTime) String

func (t *ProcCpuTime) String() string

type ProcMemStat

type ProcMemStat struct {
	Size       uint64  `json:"size"`
	Rss        uint64  `json:"rss"`
	RssPercent float64 `json:"rss_p"`
	Share      uint64  `json:"share"`
}

func (*ProcMemStat) String

func (m *ProcMemStat) String() string

type Process

type Process struct {
	Pid   int          `json:"pid"`
	Ppid  int          `json:"ppid"`
	Name  string       `json:"name"`
	State string       `json:"state"`
	Mem   *ProcMemStat `json:"mem"`
	Cpu   *ProcCpuTime `json:"cpu"`
	// contains filtered or unexported fields
}

func GetProcess

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

func (*Process) String

func (p *Process) String() string

type ProcsMap

type ProcsMap map[int]*Process

type SwapStat

type SwapStat struct {
	Total       uint64  `json:"total"`
	Used        uint64  `json:"used"`
	Free        uint64  `json:"free"`
	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)

func (*SystemLoad) String

func (t *SystemLoad) String() string

type TopConfig

type TopConfig struct {
	Period *int64
	Procs  *[]string
	Stats  struct {
		System     *bool `yaml:"system"`
		Proc       *bool `yaml:"process"`
		Filesystem *bool `yaml:"filesystem"`
		CpuPerCore *bool `yaml:"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