2015-08-06 00:19:36 +08:00
|
|
|
package docker
|
|
|
|
|
|
|
|
import "errors"
|
|
|
|
|
2015-08-07 09:14:14 +08:00
|
|
|
var ErrDockerNotAvailable = errors.New("docker not available")
|
|
|
|
var ErrCgroupNotAvailable = errors.New("cgroup not available")
|
2015-08-06 00:19:36 +08:00
|
|
|
|
|
|
|
type CgroupMemStat struct {
|
2016-03-23 09:52:46 +08:00
|
|
|
ContainerID string `json:"containerID"`
|
2015-08-06 00:19:36 +08:00
|
|
|
Cache uint64 `json:"cache"`
|
|
|
|
RSS uint64 `json:"rss"`
|
2016-03-23 09:52:46 +08:00
|
|
|
RSSHuge uint64 `json:"rssHuge"`
|
|
|
|
MappedFile uint64 `json:"mappedFile"`
|
2015-08-06 00:19:36 +08:00
|
|
|
Pgpgin uint64 `json:"pgpgin"`
|
|
|
|
Pgpgout uint64 `json:"pgpgout"`
|
|
|
|
Pgfault uint64 `json:"pgfault"`
|
|
|
|
Pgmajfault uint64 `json:"pgmajfault"`
|
2016-03-23 09:52:46 +08:00
|
|
|
InactiveAnon uint64 `json:"inactiveAnon"`
|
|
|
|
ActiveAnon uint64 `json:"activeAnon"`
|
|
|
|
InactiveFile uint64 `json:"inactiveFile"`
|
|
|
|
ActiveFile uint64 `json:"activeFile"`
|
2015-08-06 00:19:36 +08:00
|
|
|
Unevictable uint64 `json:"unevictable"`
|
2016-03-23 09:52:46 +08:00
|
|
|
HierarchicalMemoryLimit uint64 `json:"hierarchicalMemoryLimit"`
|
|
|
|
TotalCache uint64 `json:"totalCache"`
|
|
|
|
TotalRSS uint64 `json:"totalRss"`
|
|
|
|
TotalRSSHuge uint64 `json:"totalRssHuge"`
|
|
|
|
TotalMappedFile uint64 `json:"totalMappedFile"`
|
|
|
|
TotalPgpgIn uint64 `json:"totalPgpgin"`
|
|
|
|
TotalPgpgOut uint64 `json:"totalPgpgout"`
|
|
|
|
TotalPgFault uint64 `json:"totalPgfault"`
|
|
|
|
TotalPgMajFault uint64 `json:"totalPgmajfault"`
|
|
|
|
TotalInactiveAnon uint64 `json:"totalInactiveAnon"`
|
|
|
|
TotalActiveAnon uint64 `json:"totalActiveAnon"`
|
|
|
|
TotalInactiveFile uint64 `json:"totalInactiveFile"`
|
|
|
|
TotalActiveFile uint64 `json:"totalActiveFile"`
|
|
|
|
TotalUnevictable uint64 `json:"totalUnevictable"`
|
|
|
|
MemUsageInBytes uint64 `json:"memUsageInBytes"`
|
|
|
|
MemMaxUsageInBytes uint64 `json:"memMaxUsageInBytes"`
|
|
|
|
MemLimitInBytes uint64 `json:"memoryLimitInBbytes"`
|
|
|
|
MemFailCnt uint64 `json:"memoryFailcnt"`
|
2015-08-06 00:19:36 +08:00
|
|
|
}
|
2016-04-24 16:15:45 +08:00
|
|
|
|
|
|
|
type CgroupDockerStat struct {
|
|
|
|
ContainerID string `json:"containerID"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Image string `json:"image"`
|
|
|
|
Status string `json:"status"`
|
|
|
|
Running bool `json:"running"`
|
|
|
|
}
|