Bump cAdvisor to v0.43.0
Bumping cAdvisor from v0.39.2 -> v0.43.0 * Also pin transitive dependencies * containerd v1.4.9 -> v1.4.11 * docker v20.10.2+incompatible> v20.10.7+incompatible Signed-off-by: David Porter <david@porter.me>
This commit is contained in:
17
vendor/github.com/google/cadvisor/machine/machine.go
generated
vendored
17
vendor/github.com/google/cadvisor/machine/machine.go
generated
vendored
@@ -21,6 +21,7 @@ import (
|
||||
"os"
|
||||
"path"
|
||||
"regexp"
|
||||
|
||||
// s390/s390x changes
|
||||
"runtime"
|
||||
"strconv"
|
||||
@@ -43,6 +44,7 @@ var (
|
||||
cpuClockSpeedMHz = regexp.MustCompile(`(?:cpu MHz|CPU MHz|clock)\s*:\s*([0-9]+\.[0-9]+)(?:MHz)?`)
|
||||
memoryCapacityRegexp = regexp.MustCompile(`MemTotal:\s*([0-9]+) kB`)
|
||||
swapCapacityRegexp = regexp.MustCompile(`SwapTotal:\s*([0-9]+) kB`)
|
||||
vendorIDRegexp = regexp.MustCompile(`vendor_id\s*:\s*(\w+)`)
|
||||
|
||||
cpuBusPath = "/sys/bus/cpu/devices/"
|
||||
isMemoryController = regexp.MustCompile("mc[0-9]+")
|
||||
@@ -54,6 +56,21 @@ var (
|
||||
const memTypeFileName = "dimm_mem_type"
|
||||
const sizeFileName = "size"
|
||||
|
||||
// GetCPUVendorID returns "vendor_id" reading /proc/cpuinfo file.
|
||||
func GetCPUVendorID(procInfo []byte) string {
|
||||
vendorID := ""
|
||||
|
||||
matches := vendorIDRegexp.FindSubmatch(procInfo)
|
||||
if len(matches) != 2 {
|
||||
klog.Warning("Cannot read vendor id correctly, set empty.")
|
||||
return vendorID
|
||||
}
|
||||
|
||||
vendorID = string(matches[1])
|
||||
|
||||
return vendorID
|
||||
}
|
||||
|
||||
// GetPhysicalCores returns number of CPU cores reading /proc/cpuinfo file or if needed information from sysfs cpu path
|
||||
func GetPhysicalCores(procInfo []byte) int {
|
||||
numCores := getUniqueMatchesCount(string(procInfo), coreRegExp)
|
||||
|
Reference in New Issue
Block a user