2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 10:17:17 +08:00

feat: 进程管理

This commit is contained in:
耗子
2024-12-03 21:14:27 +08:00
parent 8c7a65a8b6
commit a3bbbfa87c
8 changed files with 336 additions and 10 deletions

37
pkg/types/process.go Normal file
View File

@@ -0,0 +1,37 @@
package types
import (
"github.com/shirou/gopsutil/net"
"github.com/shirou/gopsutil/process"
)
type ProcessData struct {
PID int32 `json:"pid"`
Name string `json:"name"`
PPID int32 `json:"ppid"`
Username string `json:"username"`
Status string `json:"status"`
Background bool `json:"background"`
StartTime string `json:"start_time"`
NumThreads int32 `json:"num_threads"`
CPU float64 `json:"cpu"`
DiskRead uint64 `json:"disk_read"`
DiskWrite uint64 `json:"disk_write"`
CmdLine string `json:"cmd_line"`
RSS uint64 `json:"rss"`
VMS uint64 `json:"vms"`
HWM uint64 `json:"hwm"`
Data uint64 `json:"data"`
Stack uint64 `json:"stack"`
Locked uint64 `json:"locked"`
Swap uint64 `json:"swap"`
Envs []string `json:"envs"`
OpenFiles []process.OpenFilesStat `json:"open_files"`
Connections []net.ConnectionStat `json:"connections"`
Nets []net.IOCountersStat `json:"nets"`
}