Documentation ¶
Index ¶
- Constants
- func Start(cfg Config) (err error)
- func Stop()
- type CPUCollector
- type Cmd
- type Collector
- type Config
- type Daemon
- type DiskCollector
- type Executor
- func (er *Executor) Go(data proto.Message, callback func(interface{}, error)) error
- func (er *Executor) SendMessage(msg proto.Message) error
- func (er *Executor) SendRequest(req *drpc.Request) error
- func (er *Executor) SendResponse(resp *drpc.Response) error
- func (er *Executor) Submit(fn interface{}, args ...interface{}) error
- type HostCollector
- type LineBuffer
- type MemCollector
- type NetCollector
- type Process
Constants ¶
View Source
const ( NET_INTERFACE_ALL = "all" NET_INTERFACE_VPN = "tun0" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CPUCollector ¶
func NewCPUCollector ¶
func NewCPUCollector() *CPUCollector
func (*CPUCollector) Result ¶
func (self *CPUCollector) Result() map[string]string
func (*CPUCollector) String ¶
func (self *CPUCollector) String() string
func (*CPUCollector) Update ¶
func (self *CPUCollector) Update()
type Cmd ¶
type Cmd struct {
// contains filtered or unexported fields
}
func CommandWithCmd ¶
func (*Cmd) ProcessState ¶
func (cmd *Cmd) ProcessState() *os.ProcessState
type Daemon ¶
type Daemon struct { // 这个选项是进程启动多少秒之后,此时状态如果是running,则我们认为启动成功了 // 默认值为1 。。非必须设置 StartSecs int // 当进程启动失败后,最大尝试启动的次数。。当超过预定次数后,将把此进程的状态置为Exited // 默认值为3 。。非必须设置。 StartRetries int // 这个是当我们向子进程发送stop信号后,到系统返回信息所等待的最大时间。 // 超过这个时间会向该子进程发送一个强制kill的信号。 StopWaitSecs int // 运行状态 State string // Cmd Cmd *exec.Cmd }
type DiskCollector ¶
func NewDiskCollector ¶
func NewDiskCollector() *DiskCollector
func (*DiskCollector) Result ¶
func (self *DiskCollector) Result() map[string]string
func (*DiskCollector) String ¶
func (self *DiskCollector) String() string
func (*DiskCollector) Update ¶
func (self *DiskCollector) Update()
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
type HostCollector ¶
type HostCollector struct {
// contains filtered or unexported fields
}
func NewHostCollector ¶
func NewHostCollector() *HostCollector
func (*HostCollector) Result ¶
func (self *HostCollector) Result() map[string]string
func (*HostCollector) String ¶
func (self *HostCollector) String() string
func (*HostCollector) Update ¶
func (self *HostCollector) Update()
type LineBuffer ¶
type LineBuffer struct {
// contains filtered or unexported fields
}
func NewLineBuffer ¶
func NewLineBuffer(line int) *LineBuffer
func (*LineBuffer) Bytes ¶
func (this *LineBuffer) Bytes() []byte
type MemCollector ¶
func NewMemCollector ¶
func NewMemCollector() *MemCollector
func (*MemCollector) Result ¶
func (self *MemCollector) Result() map[string]string
func (*MemCollector) String ¶
func (self *MemCollector) String() string
func (*MemCollector) Update ¶
func (self *MemCollector) Update()
type NetCollector ¶
func NewNetCollector ¶
func NewNetCollector() *NetCollector
func (*NetCollector) Result ¶
func (self *NetCollector) Result() map[string]string
func (*NetCollector) String ¶
func (self *NetCollector) String() string
func (*NetCollector) Update ¶
func (self *NetCollector) Update()
type Process ¶
type Process struct { Pid int32 `json:"pid"` Stderr string `json:"stderr"` ID int32 `json:"id"` Name string `json:"name"` State string `json:"state"` CreateTime int64 `json:"create_time"` // contains filtered or unexported fields }
func NewProcess ¶
func (*Process) CPUPercent ¶
func (*Process) MemoryPercent ¶
Click to show internal directories.
Click to hide internal directories.