File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -230,24 +230,19 @@ func ParseMemAndSwapStatus(s string) error {
230
230
switch true {
231
231
case strings .HasPrefix (line , "MemTotal:" ):
232
232
Status .Mem .Total = size
233
- fallthrough
234
233
case strings .HasPrefix (line , "MemFree:" ):
235
234
Status .Mem .Free = size
236
- Status .Mem .Used = Status .Mem .Total - Status .Mem .Free
237
- fallthrough
238
235
case strings .HasPrefix (line , "MemAvailable:" ):
239
236
Status .Mem .Avail = size
240
237
case strings .HasPrefix (line , "SwapTotal:" ):
241
238
Status .Swap .Total = size
242
- fallthrough
243
239
case strings .HasPrefix (line , "SwapFree:" ):
244
240
Status .Swap .Free = size
245
- Status .Swap .Used = Status .Swap .Total - Status .Swap .Free
246
- fallthrough
247
241
case strings .HasPrefix (line , "SwapCached:" ):
248
- Status .Swap .Cached = size
242
+ Status .Swap .Used = size
249
243
}
250
244
}
245
+ Status .Mem .Used = Status .Mem .Total - Status .Mem .Avail
251
246
return nil
252
247
}
253
248
You can’t perform that action at this time.
0 commit comments