MCPcopy
hub / github.com/google/cadvisor / GetCacheInfo

Function GetCacheInfo

lib/utils/sysinfo/sysinfo.go:519–537  ·  view source on GitHub ↗

GetCacheInfo return information about a cache accessible from the given cpu thread

(sysFs sysfs.SysFs, id int)

Source from the content-addressed store, hash-verified

517
518// GetCacheInfo return information about a cache accessible from the given cpu thread
519func GetCacheInfo(sysFs sysfs.SysFs, id int) ([]sysfs.CacheInfo, error) {
520 caches, err := sysFs.GetCaches(id)
521 if err != nil {
522 return nil, err
523 }
524
525 info := []sysfs.CacheInfo{}
526 for _, cache := range caches {
527 if !strings.HasPrefix(cache.Name(), "index") {
528 continue
529 }
530 cacheInfo, err := sysFs.GetCacheInfo(id, cache.Name())
531 if err != nil {
532 return nil, err
533 }
534 info = append(info, cacheInfo)
535 }
536 return info, nil
537}
538
539func getNetworkStats(name string, sysFs sysfs.SysFs) (info.InterfaceStats, error) {
540 var stats info.InterfaceStats

Callers 2

TestGetCacheInfoFunction · 0.85
addCacheInfoFunction · 0.85

Calls 3

GetCachesMethod · 0.65
NameMethod · 0.65
GetCacheInfoMethod · 0.65

Tested by 1

TestGetCacheInfoFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…