File: types.go

package info (click to toggle)
incus 6.0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,392 kB
  • sloc: sh: 16,313; ansic: 3,121; python: 457; makefile: 337; ruby: 51; sql: 50; lisp: 6
file content (37 lines) | stat: -rw-r--r-- 833 bytes parent folder | download | duplicates (8)
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
package cgroup

var cgPath = "/sys/fs/cgroup"

// Backend indicates whether to use v1, v2 or unavailable.
type Backend int

const (
	// Unavailable indicates the lack of controller.
	Unavailable = Backend(0)

	// V1 indicates the controller is backed by Cgroup V1.
	V1 = Backend(1)

	// V2 indicates the controller is backed by Cgroup V2.
	V2 = Backend(2)
)

// The ReadWriter interface is used to read/write cgroup data.
type ReadWriter interface {
	Get(backend Backend, controller string, key string) (string, error)
	Set(backend Backend, controller string, key string, value string) error
}

// IOStats represent IO stats.
type IOStats struct {
	ReadBytes       uint64
	ReadsCompleted  uint64
	WrittenBytes    uint64
	WritesCompleted uint64
}

// CPUStats represent CPU stats.
type CPUStats struct {
	User   int64
	System int64
}