Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPidByName ¶
GetPidByName 需要提供完整程序名字 rg:"foo.exe"
Types ¶
type CPUCollector ¶
type CPUCollector struct{}
CPUCollector CPU 使用率采集器
func (*CPUCollector) Names ¶
func (c *CPUCollector) Names() []string
type Collector ¶
type Collector interface {
Names() []string
Collect(p *process.Process, now time.Time) ([]string, error)
}
Collector 定义采集器接口
type DiskCollector ¶
type DiskCollector struct {
// contains filtered or unexported fields
}
DiskCollector 磁盘采集器(必须初始化path)
func (*DiskCollector) Names ¶
func (d *DiskCollector) Names() []string
type IOCollector ¶
type IOCollector struct {
// contains filtered or unexported fields
}
IOCollector IO 采集器(含速率计算)
func (*IOCollector) Names ¶
func (c *IOCollector) Names() []string
type MemoryCollector ¶
type MemoryCollector struct{}
MemoryCollector 内存采集器
func (*MemoryCollector) Names ¶
func (m *MemoryCollector) Names() []string
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor 监控器
func NewCustomMonitor ¶
func NewCustomMonitor(pid int, interval time.Duration, collectors []Collector, writer fileio.Files) *Monitor
NewCustomMonitor 通用构造函数
func NewDefaultMonitor ¶
NewDefaultMonitor 默认构造函数
type NetCollector ¶
type NetCollector struct {
// contains filtered or unexported fields
}
NetCollector 网络信息采集器
func (*NetCollector) Names ¶
func (c *NetCollector) Names() []string
Click to show internal directories.
Click to hide internal directories.