summaryrefslogtreecommitdiff
path: root/vendor/github.com/containerd/cgroups/stats.go
blob: 47fbfa96b5d9bd6256b467aaf6bcfb97a2c1a733 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package cgroups

import "sync"

type Stats struct {
	cpuMu sync.Mutex

	Hugetlb map[string]HugetlbStat
	Pids    *PidsStat
	Cpu     *CpuStat
	Memory  *MemoryStat
	Blkio   *BlkioStat
}

type HugetlbStat struct {
	Usage   uint64
	Max     uint64
	Failcnt uint64
}

type PidsStat struct {
	Current uint64
	Limit   uint64
}

type CpuStat struct {
	Usage      CpuUsage
	Throttling Throttle
}

type CpuUsage struct {
	// Units: nanoseconds.
	Total  uint64
	PerCpu []uint64
	Kernel uint64
	User   uint64
}

type Throttle struct {
	Periods          uint64
	ThrottledPeriods uint64
	ThrottledTime    uint64
}

type MemoryStat struct {
	Cache                   uint64
	RSS                     uint64
	RSSHuge                 uint64
	MappedFile              uint64
	Dirty                   uint64
	Writeback               uint64
	PgPgIn                  uint64
	PgPgOut                 uint64
	PgFault                 uint64
	PgMajFault              uint64
	InactiveAnon            uint64
	ActiveAnon              uint64
	InactiveFile            uint64
	ActiveFile              uint64
	Unevictable             uint64
	HierarchicalMemoryLimit uint64
	HierarchicalSwapLimit   uint64
	TotalCache              uint64
	TotalRSS                uint64
	TotalRSSHuge            uint64
	TotalMappedFile         uint64
	TotalDirty              uint64
	TotalWriteback          uint64
	TotalPgPgIn             uint64
	TotalPgPgOut            uint64
	TotalPgFault            uint64
	TotalPgMajFault         uint64
	TotalInactiveAnon       uint64
	TotalActiveAnon         uint64
	TotalInactiveFile       uint64
	TotalActiveFile         uint64
	TotalUnevictable        uint64

	Usage     MemoryEntry
	Swap      MemoryEntry
	Kernel    MemoryEntry
	KernelTCP MemoryEntry
}

type MemoryEntry struct {
	Limit   uint64
	Usage   uint64
	Max     uint64
	Failcnt uint64
}

type BlkioStat struct {
	IoServiceBytesRecursive []BlkioEntry
	IoServicedRecursive     []BlkioEntry
	IoQueuedRecursive       []BlkioEntry
	IoServiceTimeRecursive  []BlkioEntry
	IoWaitTimeRecursive     []BlkioEntry
	IoMergedRecursive       []BlkioEntry
	IoTimeRecursive         []BlkioEntry
	SectorsRecursive        []BlkioEntry
}

type BlkioEntry struct {
	Op     string
	Device string
	Major  uint64
	Minor  uint64
	Value  uint64
}