We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f37223b commit 6c055d0Copy full SHA for 6c055d0
web/controller/common.go
@@ -114,13 +114,20 @@ func ServerInfo() *ResponseBody {
114
smInfo, _ := mem.SwapMemory()
115
diskInfo, _ := disk.Usage("/")
116
loadInfo, _ := load.Avg()
117
+ tcpCon, _ := net.Connections("tcp")
118
+ udpCon, _ := net.Connections("udp")
119
+ netCount := map[string]int{
120
+ "tcp": len(tcpCon),
121
+ "udp": len(udpCon),
122
+ }
123
responseBody.Data = map[string]interface{}{
- "cpu": cpuPercent,
- "memory": vmInfo,
- "swap": smInfo,
- "disk": diskInfo,
- "load": loadInfo,
- "speed": si,
124
+ "cpu": cpuPercent,
125
+ "memory": vmInfo,
126
+ "swap": smInfo,
127
+ "disk": diskInfo,
128
+ "load": loadInfo,
129
+ "speed": si,
130
+ "netCount": netCount,
131
}
132
return &responseBody
133
0 commit comments