Documentation ¶
Index ¶
- Constants
- func AddHandle(h HandleFunc)
- func ConnectToInfluxdb(addr string, db string) error
- func HandleInfluxdb(s *Sample)
- func SetLogger(log *log.Logger)
- func SetMonitorProcess(names []string)
- func Start(period int) error
- func Stop()
- type CPUInfo
- type Cache
- type HandleFunc
- type LinuxInfo
- func (li *LinuxInfo) GetCPUInfo(target int, cpus []CPUInfo) (int, error)
- func (li *LinuxInfo) GetCPUNum() int
- func (li *LinuxInfo) GetMemInfo(m *MemInfo) error
- func (li *LinuxInfo) GetProcessInfo(pid int, p *ProcessInfo) error
- func (li *LinuxInfo) GetProcessPids(names []string) (map[string][]int, error)
- func (li *LinuxInfo) Init()
- type MemInfo
- type ProcessInfo
- type Sample
- func (s *Sample) Action() (time.Duration, error)
- func (s *Sample) GetCPUIdle(id int) float32
- func (s *Sample) GetCPUIoWait(id int) float32
- func (s *Sample) GetCPULoad(id int) float32
- func (s *Sample) GetCPUNice(id int) float32
- func (s *Sample) GetCPUSys(id int) float32
- func (s *Sample) GetCPUTimeStamp() time.Time
- func (s *Sample) GetCPUUser(id int) float32
- func (s *Sample) GetMemBufferSize() uint64
- func (s *Sample) GetMemCacheSize() uint64
- func (s *Sample) GetMemFreeSize() uint64
- func (s *Sample) GetMemTimeStamp() time.Time
- func (s *Sample) GetMemTotalSize() uint64
- func (s *Sample) GetMemUsaged() float32
- func (s *Sample) GetProcessCPULoad(pid int) float32
- func (s *Sample) GetProcessMemSize(pid int) uint64
- func (s *Sample) GetProcessMemUsaged(pid int) float32
- func (s *Sample) GetProcessName(pid int) string
- func (s *Sample) GetProcessPids() []int
- func (s *Sample) GetProcessTimeStamp(pid int) time.Time
- func (s *Sample) GetProcessVMemSize(pid int) uint64
- type SysInfo
Constants ¶
const ( // CPUAll is for reading all cpu jiffies CPUAll = 0 // CPUSum is just read one sum of cpu jiffies CPUSum = 1 )
Variables ¶
This section is empty.
Functions ¶
func ConnectToInfluxdb ¶
ConnectToInfluxdb create database client
func SetMonitorProcess ¶
func SetMonitorProcess(names []string)
SetMonitorProcess accepts names of processes
Types ¶
type CPUInfo ¶
type CPUInfo struct {
// contains filtered or unexported fields
}
CPUInfo for cpu calc
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache for cpu and processes
type LinuxInfo ¶
type LinuxInfo struct{}
LinuxInfo is for linux platform
func (*LinuxInfo) GetCPUInfo ¶
GetCPUInfo returns cpu jiffies
func (*LinuxInfo) GetMemInfo ¶
GetMemInfo returns memory usaged infos
func (*LinuxInfo) GetProcessInfo ¶
func (li *LinuxInfo) GetProcessInfo(pid int, p *ProcessInfo) error
GetProcessInfo returns process stats
func (*LinuxInfo) GetProcessPids ¶
GetProcessPids return pids of process names
type MemInfo ¶
type MemInfo struct {
// contains filtered or unexported fields
}
MemInfo for os memory
type ProcessInfo ¶
type ProcessInfo struct {
// contains filtered or unexported fields
}
ProcessInfo for Process calc
type Sample ¶
type Sample struct {
// contains filtered or unexported fields
}
Sample unit for objects
func (*Sample) GetCPUIdle ¶
GetCPUIdle return the load average
func (*Sample) GetCPUIoWait ¶
GetCPUIoWait return the load average
func (*Sample) GetCPULoad ¶
GetCPULoad return the load average
func (*Sample) GetCPUNice ¶
GetCPUNice return the load average
func (*Sample) GetCPUTimeStamp ¶
GetCPUTimeStamp return sample time stamp
func (*Sample) GetCPUUser ¶
GetCPUUser return the load average
func (*Sample) GetMemBufferSize ¶
GetMemBufferSize return the mem free size
func (*Sample) GetMemCacheSize ¶
GetMemCacheSize return the mem free size
func (*Sample) GetMemFreeSize ¶
GetMemFreeSize return the mem free size
func (*Sample) GetMemTimeStamp ¶
GetMemTimeStamp return sample time stamp
func (*Sample) GetMemTotalSize ¶
GetMemTotalSize return the mem totalsize
func (*Sample) GetMemUsaged ¶
GetMemUsaged return the mem usaged
func (*Sample) GetProcessCPULoad ¶
GetProcessCPULoad return the process cpu load
func (*Sample) GetProcessMemSize ¶
GetProcessMemSize return the process mem size
func (*Sample) GetProcessMemUsaged ¶
GetProcessMemUsaged return the process mem usaged
func (*Sample) GetProcessName ¶
GetProcessName return the process name
func (*Sample) GetProcessPids ¶
GetProcessPids returns pids of processes
func (*Sample) GetProcessTimeStamp ¶
GetProcessTimeStamp return the process name
func (*Sample) GetProcessVMemSize ¶
GetProcessVMemSize return the process virtual mem size