|
|
|
@ -11,34 +11,34 @@ import (
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type CgroupMemStat struct {
|
|
|
|
|
ContainerID string `json:"containerid"`
|
|
|
|
|
Cache uint64 `json:"cache"`
|
|
|
|
|
RSS uint64 `json:"rss"`
|
|
|
|
|
Rss_huge uint64 `json:"rss_huge"`
|
|
|
|
|
Mapped_file uint64 `json:"mapped_file"`
|
|
|
|
|
Pgpgin uint64 `json:"pgpgin"`
|
|
|
|
|
Pgpgout uint64 `json:"pgpgout"`
|
|
|
|
|
Pgfault uint64 `json:"pgfault"`
|
|
|
|
|
Pgmajfault uint64 `json:"pgmajfault"`
|
|
|
|
|
Inactive_anon uint64 `json:"inactive_anon"`
|
|
|
|
|
Active_anon uint64 `json:"active_anon"`
|
|
|
|
|
Inactive_file uint64 `json:"inactive_file"`
|
|
|
|
|
Active_file uint64 `json:"active_file"`
|
|
|
|
|
Unevictable uint64 `json:"unevictable"`
|
|
|
|
|
Hierarchical_memory_limit uint64 `json:"hierarchical_memory_limit"`
|
|
|
|
|
Total_cache uint64 `json:"total_cache"`
|
|
|
|
|
Total_rss uint64 `json:"total_rss"`
|
|
|
|
|
Total_rss_huge uint64 `json:"total_rss_huge"`
|
|
|
|
|
Total_mapped_file uint64 `json:"total_mapped_file"`
|
|
|
|
|
Total_pgpgin uint64 `json:"total_pgpgin"`
|
|
|
|
|
Total_pgpgout uint64 `json:"total_pgpgout"`
|
|
|
|
|
Total_pgfault uint64 `json:"total_pgfault"`
|
|
|
|
|
Total_pgmajfault uint64 `json:"total_pgmajfault"`
|
|
|
|
|
Total_inactive_anon uint64 `json:"total_inactive_anon"`
|
|
|
|
|
Total_active_anon uint64 `json:"total_active_anon"`
|
|
|
|
|
Total_inactive_file uint64 `json:"total_inactive_file"`
|
|
|
|
|
Total_active_file uint64 `json:"total_active_file"`
|
|
|
|
|
Total_unevictable uint64 `json:"total_unevictable"`
|
|
|
|
|
ContainerID string `json:"containerid"`
|
|
|
|
|
Cache uint64 `json:"cache"`
|
|
|
|
|
RSS uint64 `json:"rss"`
|
|
|
|
|
RSSHuge uint64 `json:"rss_huge"`
|
|
|
|
|
MappedFile uint64 `json:"mapped_file"`
|
|
|
|
|
Pgpgin uint64 `json:"pgpgin"`
|
|
|
|
|
Pgpgout uint64 `json:"pgpgout"`
|
|
|
|
|
Pgfault uint64 `json:"pgfault"`
|
|
|
|
|
Pgmajfault uint64 `json:"pgmajfault"`
|
|
|
|
|
InactiveAnon uint64 `json:"inactive_anon"`
|
|
|
|
|
ActiveAnon uint64 `json:"active_anon"`
|
|
|
|
|
InctiveFile uint64 `json:"inactive_file"`
|
|
|
|
|
ActiveFile uint64 `json:"active_file"`
|
|
|
|
|
Unevictable uint64 `json:"unevictable"`
|
|
|
|
|
HierarchicalMemoryLimit uint64 `json:"hierarchical_memory_limit"`
|
|
|
|
|
TotalCache uint64 `json:"total_cache"`
|
|
|
|
|
TotalRSS uint64 `json:"total_rss"`
|
|
|
|
|
TotalRSSHuge uint64 `json:"total_rss_huge"`
|
|
|
|
|
TotalMappedFile uint64 `json:"total_mapped_file"`
|
|
|
|
|
TotalPgpgIn uint64 `json:"total_pgpgin"`
|
|
|
|
|
TotalPgpgOut uint64 `json:"total_pgpgout"`
|
|
|
|
|
TotalPgFault uint64 `json:"total_pgfault"`
|
|
|
|
|
TotalPgMajFault uint64 `json:"total_pgmajfault"`
|
|
|
|
|
TotalInactiveAnon uint64 `json:"total_inactive_anon"`
|
|
|
|
|
TotalActiveAnon uint64 `json:"total_active_anon"`
|
|
|
|
|
TotalInactiveFile uint64 `json:"total_inactive_file"`
|
|
|
|
|
TotalActiveFile uint64 `json:"total_active_file"`
|
|
|
|
|
TotalUnevictable uint64 `json:"total_unevictable"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetDockerIDList returnes a list of DockerID.
|
|
|
|
@ -120,9 +120,9 @@ func CgroupMem(containerid string, base string) (*CgroupMemStat, error) {
|
|
|
|
|
case "rss":
|
|
|
|
|
ret.RSS = v
|
|
|
|
|
case "rss_huge":
|
|
|
|
|
ret.Rss_huge = v
|
|
|
|
|
ret.RSSHuge = v
|
|
|
|
|
case "mapped_file":
|
|
|
|
|
ret.Mapped_file = v
|
|
|
|
|
ret.MappedFile = v
|
|
|
|
|
case "pgpgin":
|
|
|
|
|
ret.Pgpgin = v
|
|
|
|
|
case "pgpgout":
|
|
|
|
@ -132,43 +132,43 @@ func CgroupMem(containerid string, base string) (*CgroupMemStat, error) {
|
|
|
|
|
case "pgmajfault":
|
|
|
|
|
ret.Pgmajfault = v
|
|
|
|
|
case "inactive_anon":
|
|
|
|
|
ret.Inactive_anon = v
|
|
|
|
|
ret.InactiveAnon = v
|
|
|
|
|
case "active_anon":
|
|
|
|
|
ret.Active_anon = v
|
|
|
|
|
ret.ActiveAnon = v
|
|
|
|
|
case "inactive_file":
|
|
|
|
|
ret.Inactive_file = v
|
|
|
|
|
ret.InctiveFile = v
|
|
|
|
|
case "active_file":
|
|
|
|
|
ret.Active_file = v
|
|
|
|
|
ret.ActiveFile = v
|
|
|
|
|
case "unevictable":
|
|
|
|
|
ret.Unevictable = v
|
|
|
|
|
case "hierarchical_memory_limit":
|
|
|
|
|
ret.Hierarchical_memory_limit = v
|
|
|
|
|
ret.HierarchicalMemoryLimit = v
|
|
|
|
|
case "total_cache":
|
|
|
|
|
ret.Total_cache = v
|
|
|
|
|
ret.TotalCache = v
|
|
|
|
|
case "total_rss":
|
|
|
|
|
ret.Total_rss = v
|
|
|
|
|
ret.TotalRSS = v
|
|
|
|
|
case "total_rss_huge":
|
|
|
|
|
ret.Total_rss_huge = v
|
|
|
|
|
ret.TotalRSSHuge = v
|
|
|
|
|
case "total_mapped_file":
|
|
|
|
|
ret.Total_mapped_file = v
|
|
|
|
|
ret.TotalMappedFile = v
|
|
|
|
|
case "total_pgpgin":
|
|
|
|
|
ret.Total_pgpgin = v
|
|
|
|
|
ret.TotalPgpgIn = v
|
|
|
|
|
case "total_pgpgout":
|
|
|
|
|
ret.Total_pgpgout = v
|
|
|
|
|
ret.TotalPgpgOut = v
|
|
|
|
|
case "total_pgfault":
|
|
|
|
|
ret.Total_pgfault = v
|
|
|
|
|
ret.TotalPgFault = v
|
|
|
|
|
case "total_pgmajfault":
|
|
|
|
|
ret.Total_pgmajfault = v
|
|
|
|
|
ret.TotalPgMajFault = v
|
|
|
|
|
case "total_inactive_anon":
|
|
|
|
|
ret.Total_inactive_anon = v
|
|
|
|
|
ret.TotalInactiveAnon = v
|
|
|
|
|
case "total_active_anon":
|
|
|
|
|
ret.Total_active_anon = v
|
|
|
|
|
ret.TotalActiveAnon = v
|
|
|
|
|
case "total_inactive_file":
|
|
|
|
|
ret.Total_inactive_file = v
|
|
|
|
|
ret.TotalInactiveFile = v
|
|
|
|
|
case "total_active_file":
|
|
|
|
|
ret.Total_active_file = v
|
|
|
|
|
ret.TotalActiveFile = v
|
|
|
|
|
case "total_unevictable":
|
|
|
|
|
ret.Total_unevictable = v
|
|
|
|
|
ret.TotalUnevictable = v
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return ret, nil
|
|
|
|
|