Updating dependency github.com/google/cadvisor to version 6a8d614

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
Davanum Srinivas
2020-05-14 17:29:52 -04:00
parent 449810c785
commit 082578c22f
109 changed files with 3417 additions and 1312 deletions

View File

@@ -12,7 +12,7 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//vendor/github.com/google/cadvisor/info/v1:go_default_library",
"//vendor/k8s.io/klog:go_default_library",
"//vendor/k8s.io/klog/v2:go_default_library",
],
)

View File

@@ -136,6 +136,8 @@ type DeprecatedContainerStats struct {
// Custom Metrics
HasCustomMetrics bool `json:"has_custom_metrics"`
CustomMetrics map[string][]v1.MetricVal `json:"custom_metrics,omitempty"`
// Referenced memory
ReferencedMemory uint64 `json:"referenced_memory,omitempty"`
}
type ContainerStats struct {
@@ -164,6 +166,10 @@ type ContainerStats struct {
Accelerators []v1.AcceleratorStats `json:"accelerators,omitempty"`
// Custom Metrics
CustomMetrics map[string][]v1.MetricVal `json:"custom_metrics,omitempty"`
// Perf events counters
PerfStats []v1.PerfStat `json:"perf_stats,omitempty"`
// Referenced memory
ReferencedMemory uint64 `json:"referenced_memory,omitempty"`
}
type Percentiles struct {

View File

@@ -19,7 +19,7 @@ import (
"time"
"github.com/google/cadvisor/info/v1"
"k8s.io/klog"
"k8s.io/klog/v2"
)
func machineFsStatsFromV1(fsStats []v1.FsStats) []MachineFsStats {
@@ -101,7 +101,8 @@ func ContainerStatsFromV1(containerName string, spec *v1.ContainerSpec, stats []
var last *v1.ContainerStats
for _, val := range stats {
stat := &ContainerStats{
Timestamp: val.Timestamp,
Timestamp: val.Timestamp,
ReferencedMemory: val.ReferencedMemory,
}
if spec.HasCpu {
stat.Cpu = &val.Cpu
@@ -151,6 +152,9 @@ func ContainerStatsFromV1(containerName string, spec *v1.ContainerSpec, stats []
if len(val.Accelerators) > 0 {
stat.Accelerators = val.Accelerators
}
if len(val.PerfStats) > 0 {
stat.PerfStats = val.PerfStats
}
// TODO(rjnagal): Handle load stats.
newStats = append(newStats, stat)
}
@@ -169,6 +173,7 @@ func DeprecatedStatsFromV1(cont *v1.ContainerInfo) []DeprecatedContainerStats {
HasFilesystem: cont.Spec.HasFilesystem,
HasDiskIo: cont.Spec.HasDiskIo,
HasCustomMetrics: cont.Spec.HasCustomMetrics,
ReferencedMemory: val.ReferencedMemory,
}
if stat.HasCpu {
stat.Cpu = val.Cpu