mirror of https://github.com/shirou/gopsutil
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
921 B
Go
39 lines
921 B
Go
11 years ago
|
package gopsutil
|
||
11 years ago
|
|
||
11 years ago
|
import (
|
||
|
"encoding/json"
|
||
|
)
|
||
|
|
||
11 years ago
|
type VirtualMemoryStat struct {
|
||
11 years ago
|
Total uint64 `json:"total"`
|
||
|
Available uint64 `json:"available"`
|
||
|
Used uint64 `json:"used"`
|
||
|
UsedPercent float64 `json:"usedPercent"`
|
||
|
Free uint64 `json:"free"`
|
||
|
Active uint64 `json:"active"`
|
||
|
Inactive uint64 `json:"inactive"`
|
||
|
Buffers uint64 `json:"buffers"`
|
||
|
Cached uint64 `json:"cached"`
|
||
|
Wired uint64 `json:"wired"`
|
||
|
Shared uint64 `json:"shared"`
|
||
|
}
|
||
|
|
||
11 years ago
|
type SwapMemoryStat struct {
|
||
11 years ago
|
Total uint64 `json:"total"`
|
||
|
Used uint64 `json:"used"`
|
||
|
Free uint64 `json:"free"`
|
||
|
UsedPercent float64 `json:"usedPercent"`
|
||
|
Sin uint64 `json:"sin"`
|
||
|
Sout uint64 `json:"sout"`
|
||
|
}
|
||
11 years ago
|
|
||
|
func (m VirtualMemoryStat) String() string {
|
||
|
s, _ := json.Marshal(m)
|
||
|
return string(s)
|
||
|
}
|
||
|
|
||
|
func (m SwapMemoryStat) String() string {
|
||
|
s, _ := json.Marshal(m)
|
||
|
return string(s)
|
||
|
}
|