Documentation
¶
Index ¶
- Variables
- func CreatePidFile(pid int, pidfile string) error
- func GetProcessName(pid int) (string, error)
- func StartService(done chan<- error, param ProcessParam)
- func StopService(param ProcessParam) error
- func StopServiceByPid(pid int) error
- type ChildrenProcess
- type Process
- type ProcessParam
- type Processes
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInterrupt = errors.New("interrupt signal accepted.")
Functions ¶
func CreatePidFile ¶
CreatePidFile pidと書き込むファイル名を受け取ってPIDファイルを作成する
func StartService ¶
func StartService(done chan<- error, param ProcessParam)
StartService 非同期サービスを起動し、PIDを知らせる
func StopService ¶
func StopService(param ProcessParam) error
StopService サービス停止コマンドを起動し、サービスが終了するまで待つ
func StopServiceByPid ¶
StopServiceByPid PIDでプロセスを識別してシグナルを送信して終了する
Types ¶
type ChildrenProcess ¶
type ChildrenProcess struct {
Name string `json:"name"`
Cmdline string `json:"cmdline"`
Pid int `json:"pid"`
CpuPercent float64 `json:"cpuPercent"`
Vms string `json:"vms"`
Rss string `json:"rss"`
Swap string `json:"swap"`
}
子プロセス情報
func GetChildProcess ¶
func GetChildProcess(pid int) ([]ChildrenProcess, float64, uint64, error)
GetChildProcess 指定されたPIDの子プロセス情報を返す
type Process ¶
type Process struct {
Name string `json:"name"`
CpuPercent float64 `json:"cpuPercent"`
CpuTotal float64 `json:"cpuTotal"`
CpuUser float64 `json:"cpuUser"`
CpuSystem float64 `json:"cpuSystem"`
CpuIdle float64 `json:"cpuIdle"`
CpuIowait float64 `json:"cpuIowait"`
Vms string `json:"vms"`
Rss string `json:"rss"`
Swap string `json:"swap"`
Cmdline string `json:"cmdline"`
Exe string `json:"exe"`
Cwd string `json:"cwd"`
Env []string `json:"env"`
CreateTime string `json:"createTime"`
Exist bool `json:"exist"`
Status string `json:"status"`
Pid int `json:"pid"`
Ppid int `json:"ppid"`
Children []ChildrenProcess `json:"children"`
SumCpuPercent float64 `json:"sumCpuPercent"`
SumRss string `json:"sumRss"`
}
プロセス情報
Click to show internal directories.
Click to hide internal directories.