Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for CpuWeightToCpuShares (0.17 sec)

  1. pkg/kubelet/cm/cgroup_manager_linux_test.go

    			cpuWeight:         245,
    			expectedCpuShares: 6398,
    		},
    		{
    			cpuWeight:         10000,
    			expectedCpuShares: 262144,
    		},
    	}
    
    	for _, testCase := range testCases {
    		if actual := CpuWeightToCpuShares(testCase.cpuWeight); actual != testCase.expectedCpuShares {
    			t.Errorf("cpuWeight: %v, expectedCpuShares: %v, actualCpuShares: %v",
    				testCase.cpuWeight, testCase.expectedCpuShares, actual)
    		}
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Feb 24 18:21:21 UTC 2023
    - 6.1K bytes
    - Viewed (0)
  2. pkg/kubelet/cm/cgroup_manager_linux.go

    }
    
    // Convert cgroup v2 cpu.weight value to cgroup v1 cpu.shares
    // https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2254-cgroup-v2#phase-1-convert-from-cgroups-v1-settings-to-v2
    func CpuWeightToCpuShares(cpuWeight uint64) uint64 {
    	return uint64((((cpuWeight - 1) * 262142) / 9999) + 2)
    }
    
    func getCgroupv1CpuConfig(cgroupPath string) (*ResourceConfig, error) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Sep 27 13:02:15 UTC 2023
    - 26.5K bytes
    - Viewed (0)
Back to top