MCPcopy Create free account
hub / github.com/containerd/cgroups / NewCPUMax

Function NewCPUMax

cgroup2/cpu.go:36–47  ·  view source on GitHub ↗
(quota *int64, period *uint64)

Source from the content-addressed store, hash-verified

34)
35
36func NewCPUMax(quota *int64, period *uint64) CPUMax {
37 max := defaultCPUMax
38 if quota != nil {
39 max = strconv.FormatInt(*quota, 10)
40 }
41
42 duration := defaultCPUMaxPeriodStr
43 if period != nil {
44 duration = strconv.FormatUint(*period, 10)
45 }
46 return CPUMax(strings.Join([]string{max, duration}, " "))
47}
48
49type CPU struct {
50 Weight *uint64

Callers 4

TestCgroupv2CpuStatsFunction · 0.85
ToResourcesFunction · 0.85

Calls 1

CPUMaxTypeAlias · 0.85

Tested by 3

TestCgroupv2CpuStatsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…