From 97fe57bba92c27cf63e4e3ffbecd1823b6fa53f7 Mon Sep 17 00:00:00 2001 From: Shireesh Anjal <355479+anjalshireesh@users.noreply.github.com> Date: Sat, 6 Feb 2021 11:02:28 +0530 Subject: [PATCH] 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. --- cmd/healthinfo.go | 2 +- pkg/madmin/health.go | 60 ++++++++++++++++++++++---------------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/cmd/healthinfo.go b/cmd/healthinfo.go index b14a26e5e..65314a9ae 100644 --- a/cmd/healthinfo.go +++ b/cmd/healthinfo.go @@ -202,7 +202,7 @@ func getLocalProcInfo(ctx context.Context, r *http.Request) madmin.ServerProcInf if err != nil { return errProcInfo("conns", err) } - sysProc.Connections = conns + sysProc.ConnectionCount = len(conns) createTime, err := proc.CreateTimeWithContext(ctx) if err != nil { diff --git a/pkg/madmin/health.go b/pkg/madmin/health.go index 8eb4e3672..4a08fa32f 100644 --- a/pkg/madmin/health.go +++ b/pkg/madmin/health.go @@ -65,36 +65,36 @@ type ServerProcInfo struct { // SysProcess - Includes process lvl information about a single process type SysProcess struct { - Pid int32 `json:"pid"` - Background bool `json:"background,omitempty"` - CPUPercent float64 `json:"cpupercent,omitempty"` - Children []int32 `json:"children,omitempty"` - CmdLine string `json:"cmd,omitempty"` - Connections []nethw.ConnectionStat `json:"connections,omitempty"` - CreateTime int64 `json:"createtime,omitempty"` - Cwd string `json:"cwd,omitempty"` - Exe string `json:"exe,omitempty"` - Gids []int32 `json:"gids,omitempty"` - IOCounters *process.IOCountersStat `json:"iocounters,omitempty"` - IsRunning bool `json:"isrunning,omitempty"` - MemInfo *process.MemoryInfoStat `json:"meminfo,omitempty"` - MemMaps *[]process.MemoryMapsStat `json:"memmaps,omitempty"` - MemPercent float32 `json:"mempercent,omitempty"` - Name string `json:"name,omitempty"` - NetIOCounters []nethw.IOCountersStat `json:"netiocounters,omitempty"` - Nice int32 `json:"nice,omitempty"` - NumCtxSwitches *process.NumCtxSwitchesStat `json:"numctxswitches,omitempty"` - NumFds int32 `json:"numfds,omitempty"` - NumThreads int32 `json:"numthreads,omitempty"` - PageFaults *process.PageFaultsStat `json:"pagefaults,omitempty"` - Parent int32 `json:"parent,omitempty"` - Ppid int32 `json:"ppid,omitempty"` - Rlimit []process.RlimitStat `json:"rlimit,omitempty"` - Status string `json:"status,omitempty"` - Tgid int32 `json:"tgid,omitempty"` - Times *cpu.TimesStat `json:"cputimes,omitempty"` - Uids []int32 `json:"uids,omitempty"` - Username string `json:"username,omitempty"` + Pid int32 `json:"pid"` + Background bool `json:"background,omitempty"` + CPUPercent float64 `json:"cpupercent,omitempty"` + Children []int32 `json:"children,omitempty"` + CmdLine string `json:"cmd,omitempty"` + ConnectionCount int `json:"connection_count,omitempty"` + CreateTime int64 `json:"createtime,omitempty"` + Cwd string `json:"cwd,omitempty"` + Exe string `json:"exe,omitempty"` + Gids []int32 `json:"gids,omitempty"` + IOCounters *process.IOCountersStat `json:"iocounters,omitempty"` + IsRunning bool `json:"isrunning,omitempty"` + MemInfo *process.MemoryInfoStat `json:"meminfo,omitempty"` + MemMaps *[]process.MemoryMapsStat `json:"memmaps,omitempty"` + MemPercent float32 `json:"mempercent,omitempty"` + Name string `json:"name,omitempty"` + NetIOCounters []nethw.IOCountersStat `json:"netiocounters,omitempty"` + Nice int32 `json:"nice,omitempty"` + NumCtxSwitches *process.NumCtxSwitchesStat `json:"numctxswitches,omitempty"` + NumFds int32 `json:"numfds,omitempty"` + NumThreads int32 `json:"numthreads,omitempty"` + PageFaults *process.PageFaultsStat `json:"pagefaults,omitempty"` + Parent int32 `json:"parent,omitempty"` + Ppid int32 `json:"ppid,omitempty"` + Rlimit []process.RlimitStat `json:"rlimit,omitempty"` + Status string `json:"status,omitempty"` + Tgid int32 `json:"tgid,omitempty"` + Times *cpu.TimesStat `json:"cputimes,omitempty"` + Uids []int32 `json:"uids,omitempty"` + Username string `json:"username,omitempty"` } // ServerMemInfo - Includes host virtual and swap mem information