Remove Connections from SysProcess struct (#11373)

The connections info of the processes takes up a huge amount of space,
and is not important for adding any useful health checks. Removing it
will significantly reduce the size of the subnet health report.
master
Shireesh Anjal 4 years ago committed by GitHub
parent 88c1bb0720
commit 97fe57bba9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cmd/healthinfo.go
  2. 60
      pkg/madmin/health.go

@ -202,7 +202,7 @@ func getLocalProcInfo(ctx context.Context, r *http.Request) madmin.ServerProcInf
if err != nil { if err != nil {
return errProcInfo("conns", err) return errProcInfo("conns", err)
} }
sysProc.Connections = conns sysProc.ConnectionCount = len(conns)
createTime, err := proc.CreateTimeWithContext(ctx) createTime, err := proc.CreateTimeWithContext(ctx)
if err != nil { if err != nil {

@ -65,36 +65,36 @@ type ServerProcInfo struct {
// SysProcess - Includes process lvl information about a single process // SysProcess - Includes process lvl information about a single process
type SysProcess struct { type SysProcess struct {
Pid int32 `json:"pid"` Pid int32 `json:"pid"`
Background bool `json:"background,omitempty"` Background bool `json:"background,omitempty"`
CPUPercent float64 `json:"cpupercent,omitempty"` CPUPercent float64 `json:"cpupercent,omitempty"`
Children []int32 `json:"children,omitempty"` Children []int32 `json:"children,omitempty"`
CmdLine string `json:"cmd,omitempty"` CmdLine string `json:"cmd,omitempty"`
Connections []nethw.ConnectionStat `json:"connections,omitempty"` ConnectionCount int `json:"connection_count,omitempty"`
CreateTime int64 `json:"createtime,omitempty"` CreateTime int64 `json:"createtime,omitempty"`
Cwd string `json:"cwd,omitempty"` Cwd string `json:"cwd,omitempty"`
Exe string `json:"exe,omitempty"` Exe string `json:"exe,omitempty"`
Gids []int32 `json:"gids,omitempty"` Gids []int32 `json:"gids,omitempty"`
IOCounters *process.IOCountersStat `json:"iocounters,omitempty"` IOCounters *process.IOCountersStat `json:"iocounters,omitempty"`
IsRunning bool `json:"isrunning,omitempty"` IsRunning bool `json:"isrunning,omitempty"`
MemInfo *process.MemoryInfoStat `json:"meminfo,omitempty"` MemInfo *process.MemoryInfoStat `json:"meminfo,omitempty"`
MemMaps *[]process.MemoryMapsStat `json:"memmaps,omitempty"` MemMaps *[]process.MemoryMapsStat `json:"memmaps,omitempty"`
MemPercent float32 `json:"mempercent,omitempty"` MemPercent float32 `json:"mempercent,omitempty"`
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`
NetIOCounters []nethw.IOCountersStat `json:"netiocounters,omitempty"` NetIOCounters []nethw.IOCountersStat `json:"netiocounters,omitempty"`
Nice int32 `json:"nice,omitempty"` Nice int32 `json:"nice,omitempty"`
NumCtxSwitches *process.NumCtxSwitchesStat `json:"numctxswitches,omitempty"` NumCtxSwitches *process.NumCtxSwitchesStat `json:"numctxswitches,omitempty"`
NumFds int32 `json:"numfds,omitempty"` NumFds int32 `json:"numfds,omitempty"`
NumThreads int32 `json:"numthreads,omitempty"` NumThreads int32 `json:"numthreads,omitempty"`
PageFaults *process.PageFaultsStat `json:"pagefaults,omitempty"` PageFaults *process.PageFaultsStat `json:"pagefaults,omitempty"`
Parent int32 `json:"parent,omitempty"` Parent int32 `json:"parent,omitempty"`
Ppid int32 `json:"ppid,omitempty"` Ppid int32 `json:"ppid,omitempty"`
Rlimit []process.RlimitStat `json:"rlimit,omitempty"` Rlimit []process.RlimitStat `json:"rlimit,omitempty"`
Status string `json:"status,omitempty"` Status string `json:"status,omitempty"`
Tgid int32 `json:"tgid,omitempty"` Tgid int32 `json:"tgid,omitempty"`
Times *cpu.TimesStat `json:"cputimes,omitempty"` Times *cpu.TimesStat `json:"cputimes,omitempty"`
Uids []int32 `json:"uids,omitempty"` Uids []int32 `json:"uids,omitempty"`
Username string `json:"username,omitempty"` Username string `json:"username,omitempty"`
} }
// ServerMemInfo - Includes host virtual and swap mem information // ServerMemInfo - Includes host virtual and swap mem information

Loading…
Cancel
Save