Update to new cadvisor v0.48.1

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
Davanum Srinivas
2023-10-31 07:51:09 -04:00
parent 0294521985
commit 8b9fc325e2
36 changed files with 425 additions and 331 deletions

View File

@@ -93,6 +93,14 @@ var AllMetrics = MetricSet{
OOMMetrics: struct{}{},
}
// AllNetworkMetrics represents all network metrics that cAdvisor supports.
var AllNetworkMetrics = MetricSet{
NetworkUsageMetrics: struct{}{},
NetworkTcpUsageMetrics: struct{}{},
NetworkAdvancedTcpUsageMetrics: struct{}{},
NetworkUdpUsageMetrics: struct{}{},
}
func (mk MetricKind) String() string {
return string(mk)
}
@@ -104,6 +112,15 @@ func (ms MetricSet) Has(mk MetricKind) bool {
return exists
}
func (ms MetricSet) HasAny(ms1 MetricSet) bool {
for m := range ms1 {
if _, ok := ms[m]; ok {
return true
}
}
return false
}
func (ms MetricSet) add(mk MetricKind) {
ms[mk] = struct{}{}
}
@@ -199,7 +216,9 @@ func InitializePlugins(factory info.MachineInfoFactory, fsInfo fs.FsInfo, includ
for name, plugin := range plugins {
watcher, err := plugin.Register(factory, fsInfo, includedMetrics)
if err != nil {
klog.V(5).Infof("Registration of the %s container factory failed: %v", name, err)
klog.Infof("Registration of the %s container factory failed: %v", name, err)
} else {
klog.Infof("Registration of the %s container factory successfully", name)
}
if watcher != nil {
containerWatchers = append(containerWatchers, watcher)