mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Updating cadvisor deps to v0.22.2
Signed-off-by: Vishnu Kannan <vishnuk@google.com>
This commit is contained in:
parent
204d426dd3
commit
750c089e63
72
Godeps/Godeps.json
generated
72
Godeps/Godeps.json
generated
@ -578,93 +578,93 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/api",
|
"ImportPath": "github.com/google/cadvisor/api",
|
||||||
"Comment": "v0.22.1",
|
"Comment": "v0.22.2",
|
||||||
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
|
"Rev": "546a3771589bdb356777c646c6eca24914fdd48b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/cache/memory",
|
"ImportPath": "github.com/google/cadvisor/cache/memory",
|
||||||
"Comment": "v0.22.1",
|
"Comment": "v0.22.2",
|
||||||
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
|
"Rev": "546a3771589bdb356777c646c6eca24914fdd48b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/collector",
|
"ImportPath": "github.com/google/cadvisor/collector",
|
||||||
"Comment": "v0.22.1",
|
"Comment": "v0.22.2",
|
||||||
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
|
"Rev": "546a3771589bdb356777c646c6eca24914fdd48b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/container",
|
"ImportPath": "github.com/google/cadvisor/container",
|
||||||
"Comment": "v0.22.1",
|
"Comment": "v0.22.2",
|
||||||
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
|
"Rev": "546a3771589bdb356777c646c6eca24914fdd48b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/events",
|
"ImportPath": "github.com/google/cadvisor/events",
|
||||||
"Comment": "v0.22.1",
|
"Comment": "v0.22.2",
|
||||||
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
|
"Rev": "546a3771589bdb356777c646c6eca24914fdd48b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/fs",
|
"ImportPath": "github.com/google/cadvisor/fs",
|
||||||
"Comment": "v0.22.1",
|
"Comment": "v0.22.2",
|
||||||
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
|
"Rev": "546a3771589bdb356777c646c6eca24914fdd48b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/healthz",
|
"ImportPath": "github.com/google/cadvisor/healthz",
|
||||||
"Comment": "v0.22.1",
|
"Comment": "v0.22.2",
|
||||||
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
|
"Rev": "546a3771589bdb356777c646c6eca24914fdd48b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/http",
|
"ImportPath": "github.com/google/cadvisor/http",
|
||||||
"Comment": "v0.22.1",
|
"Comment": "v0.22.2",
|
||||||
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
|
"Rev": "546a3771589bdb356777c646c6eca24914fdd48b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/info/v1",
|
"ImportPath": "github.com/google/cadvisor/info/v1",
|
||||||
"Comment": "v0.22.1",
|
"Comment": "v0.22.2",
|
||||||
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
|
"Rev": "546a3771589bdb356777c646c6eca24914fdd48b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/info/v2",
|
"ImportPath": "github.com/google/cadvisor/info/v2",
|
||||||
"Comment": "v0.22.1",
|
"Comment": "v0.22.2",
|
||||||
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
|
"Rev": "546a3771589bdb356777c646c6eca24914fdd48b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/manager",
|
"ImportPath": "github.com/google/cadvisor/manager",
|
||||||
"Comment": "v0.22.1",
|
"Comment": "v0.22.2",
|
||||||
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
|
"Rev": "546a3771589bdb356777c646c6eca24914fdd48b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/metrics",
|
"ImportPath": "github.com/google/cadvisor/metrics",
|
||||||
"Comment": "v0.22.1",
|
"Comment": "v0.22.2",
|
||||||
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
|
"Rev": "546a3771589bdb356777c646c6eca24914fdd48b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/pages",
|
"ImportPath": "github.com/google/cadvisor/pages",
|
||||||
"Comment": "v0.22.1",
|
"Comment": "v0.22.2",
|
||||||
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
|
"Rev": "546a3771589bdb356777c646c6eca24914fdd48b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/storage",
|
"ImportPath": "github.com/google/cadvisor/storage",
|
||||||
"Comment": "v0.22.1",
|
"Comment": "v0.22.2",
|
||||||
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
|
"Rev": "546a3771589bdb356777c646c6eca24914fdd48b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/summary",
|
"ImportPath": "github.com/google/cadvisor/summary",
|
||||||
"Comment": "v0.22.1",
|
"Comment": "v0.22.2",
|
||||||
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
|
"Rev": "546a3771589bdb356777c646c6eca24914fdd48b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/utils",
|
"ImportPath": "github.com/google/cadvisor/utils",
|
||||||
"Comment": "v0.22.1",
|
"Comment": "v0.22.2",
|
||||||
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
|
"Rev": "546a3771589bdb356777c646c6eca24914fdd48b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/validate",
|
"ImportPath": "github.com/google/cadvisor/validate",
|
||||||
"Comment": "v0.22.1",
|
"Comment": "v0.22.2",
|
||||||
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
|
"Rev": "546a3771589bdb356777c646c6eca24914fdd48b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/version",
|
"ImportPath": "github.com/google/cadvisor/version",
|
||||||
"Comment": "v0.22.1",
|
"Comment": "v0.22.2",
|
||||||
"Rev": "b344feb952c13e0730fa52eb5e5cf1cf7130ee9c"
|
"Rev": "546a3771589bdb356777c646c6eca24914fdd48b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/gofuzz",
|
"ImportPath": "github.com/google/gofuzz",
|
||||||
|
43
Godeps/_workspace/src/github.com/google/cadvisor/container/libcontainer/helpers.go
generated
vendored
43
Godeps/_workspace/src/github.com/google/cadvisor/container/libcontainer/helpers.go
generated
vendored
@ -92,29 +92,30 @@ func GetStats(cgroupManager cgroups.Manager, rootFs string, pid int, ignoreMetri
|
|||||||
stats := toContainerStats(libcontainerStats)
|
stats := toContainerStats(libcontainerStats)
|
||||||
|
|
||||||
// If we know the pid then get network stats from /proc/<pid>/net/dev
|
// If we know the pid then get network stats from /proc/<pid>/net/dev
|
||||||
if pid > 0 {
|
if pid == 0 {
|
||||||
if !ignoreMetrics.Has(container.NetworkUsageMetrics) {
|
return stats, nil
|
||||||
netStats, err := networkStatsFromProc(rootFs, pid)
|
}
|
||||||
if err != nil {
|
if !ignoreMetrics.Has(container.NetworkUsageMetrics) {
|
||||||
glog.V(2).Infof("Unable to get network stats from pid %d: %v", pid, err)
|
netStats, err := networkStatsFromProc(rootFs, pid)
|
||||||
} else {
|
if err != nil {
|
||||||
stats.Network.Interfaces = append(stats.Network.Interfaces, netStats...)
|
glog.V(2).Infof("Unable to get network stats from pid %d: %v", pid, err)
|
||||||
}
|
} else {
|
||||||
|
stats.Network.Interfaces = append(stats.Network.Interfaces, netStats...)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !ignoreMetrics.Has(container.NetworkTcpUsageMetrics) {
|
||||||
|
t, err := tcpStatsFromProc(rootFs, pid, "net/tcp")
|
||||||
|
if err != nil {
|
||||||
|
glog.V(2).Infof("Unable to get tcp stats from pid %d: %v", pid, err)
|
||||||
|
} else {
|
||||||
|
stats.Network.Tcp = t
|
||||||
}
|
}
|
||||||
if !ignoreMetrics.Has(container.NetworkTcpUsageMetrics) {
|
|
||||||
t, err := tcpStatsFromProc(rootFs, pid, "net/tcp")
|
|
||||||
if err != nil {
|
|
||||||
glog.V(2).Infof("Unable to get tcp stats from pid %d: %v", pid, err)
|
|
||||||
} else {
|
|
||||||
stats.Network.Tcp = t
|
|
||||||
}
|
|
||||||
|
|
||||||
t6, err := tcpStatsFromProc(rootFs, pid, "net/tcp6")
|
t6, err := tcpStatsFromProc(rootFs, pid, "net/tcp6")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.V(2).Infof("Unable to get tcp6 stats from pid %d: %v", pid, err)
|
glog.V(2).Infof("Unable to get tcp6 stats from pid %d: %v", pid, err)
|
||||||
} else {
|
} else {
|
||||||
stats.Network.Tcp6 = t6
|
stats.Network.Tcp6 = t6
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
18
Godeps/_workspace/src/github.com/google/cadvisor/container/raw/handler.go
generated
vendored
18
Godeps/_workspace/src/github.com/google/cadvisor/container/raw/handler.go
generated
vendored
@ -64,6 +64,12 @@ type rawContainerHandler struct {
|
|||||||
|
|
||||||
// Metrics to be ignored.
|
// Metrics to be ignored.
|
||||||
ignoreMetrics container.MetricSet
|
ignoreMetrics container.MetricSet
|
||||||
|
|
||||||
|
pid int
|
||||||
|
}
|
||||||
|
|
||||||
|
func isRootCgroup(name string) bool {
|
||||||
|
return name == "/"
|
||||||
}
|
}
|
||||||
|
|
||||||
func newRawContainerHandler(name string, cgroupSubsystems *libcontainer.CgroupSubsystems, machineInfoFactory info.MachineInfoFactory, fsInfo fs.FsInfo, watcher *InotifyWatcher, rootFs string, ignoreMetrics container.MetricSet) (container.ContainerHandler, error) {
|
func newRawContainerHandler(name string, cgroupSubsystems *libcontainer.CgroupSubsystems, machineInfoFactory info.MachineInfoFactory, fsInfo fs.FsInfo, watcher *InotifyWatcher, rootFs string, ignoreMetrics container.MetricSet) (container.ContainerHandler, error) {
|
||||||
@ -94,6 +100,11 @@ func newRawContainerHandler(name string, cgroupSubsystems *libcontainer.CgroupSu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pid := 0
|
||||||
|
if isRootCgroup(name) {
|
||||||
|
pid = 1
|
||||||
|
}
|
||||||
|
|
||||||
return &rawContainerHandler{
|
return &rawContainerHandler{
|
||||||
name: name,
|
name: name,
|
||||||
cgroupSubsystems: cgroupSubsystems,
|
cgroupSubsystems: cgroupSubsystems,
|
||||||
@ -106,6 +117,7 @@ func newRawContainerHandler(name string, cgroupSubsystems *libcontainer.CgroupSu
|
|||||||
watcher: watcher,
|
watcher: watcher,
|
||||||
rootFs: rootFs,
|
rootFs: rootFs,
|
||||||
ignoreMetrics: ignoreMetrics,
|
ignoreMetrics: ignoreMetrics,
|
||||||
|
pid: pid,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,7 +162,7 @@ func readUInt64(dirpath string, file string) uint64 {
|
|||||||
|
|
||||||
func (self *rawContainerHandler) GetRootNetworkDevices() ([]info.NetInfo, error) {
|
func (self *rawContainerHandler) GetRootNetworkDevices() ([]info.NetInfo, error) {
|
||||||
nd := []info.NetInfo{}
|
nd := []info.NetInfo{}
|
||||||
if self.name == "/" {
|
if isRootCgroup(self.name) {
|
||||||
mi, err := self.machineInfoFactory.GetMachineInfo()
|
mi, err := self.machineInfoFactory.GetMachineInfo()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nd, err
|
return nd, err
|
||||||
@ -278,7 +290,7 @@ func (self *rawContainerHandler) GetSpec() (info.ContainerSpec, error) {
|
|||||||
|
|
||||||
func (self *rawContainerHandler) getFsStats(stats *info.ContainerStats) error {
|
func (self *rawContainerHandler) getFsStats(stats *info.ContainerStats) error {
|
||||||
// Get Filesystem information only for the root cgroup.
|
// Get Filesystem information only for the root cgroup.
|
||||||
if self.name == "/" {
|
if isRootCgroup(self.name) {
|
||||||
filesystems, err := self.fsInfo.GetGlobalFsInfo()
|
filesystems, err := self.fsInfo.GetGlobalFsInfo()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -341,7 +353,7 @@ func (self *rawContainerHandler) getFsStats(stats *info.ContainerStats) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self *rawContainerHandler) GetStats() (*info.ContainerStats, error) {
|
func (self *rawContainerHandler) GetStats() (*info.ContainerStats, error) {
|
||||||
stats, err := libcontainer.GetStats(self.cgroupManager, self.rootFs, os.Getpid(), self.ignoreMetrics)
|
stats, err := libcontainer.GetStats(self.cgroupManager, self.rootFs, self.pid, self.ignoreMetrics)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return stats, err
|
return stats, err
|
||||||
}
|
}
|
||||||
|
40
Godeps/_workspace/src/github.com/google/cadvisor/manager/manager.go
generated
vendored
40
Godeps/_workspace/src/github.com/google/cadvisor/manager/manager.go
generated
vendored
@ -50,42 +50,6 @@ var eventStorageAgeLimit = flag.String("event_storage_age_limit", "default=24h",
|
|||||||
var eventStorageEventLimit = flag.String("event_storage_event_limit", "default=100000", "Max number of events to store (per type). Value is a comma separated list of key values, where the keys are event types (e.g.: creation, oom) or \"default\" and the value is an integer. Default is applied to all non-specified event types")
|
var eventStorageEventLimit = flag.String("event_storage_event_limit", "default=100000", "Max number of events to store (per type). Value is a comma separated list of key values, where the keys are event types (e.g.: creation, oom) or \"default\" and the value is an integer. Default is applied to all non-specified event types")
|
||||||
var applicationMetricsCountLimit = flag.Int("application_metrics_count_limit", 100, "Max number of application metrics to store (per container)")
|
var applicationMetricsCountLimit = flag.Int("application_metrics_count_limit", 100, "Max number of application metrics to store (per container)")
|
||||||
|
|
||||||
var (
|
|
||||||
// Metrics to be ignored.
|
|
||||||
ignoreMetrics metricSetValue = metricSetValue{container.MetricSet{}}
|
|
||||||
// List of metrics that can be ignored.
|
|
||||||
ignoreWhitelist = container.MetricSet{
|
|
||||||
container.DiskUsageMetrics: struct{}{},
|
|
||||||
container.NetworkUsageMetrics: struct{}{},
|
|
||||||
container.NetworkTcpUsageMetrics: struct{}{},
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
flag.Var(&ignoreMetrics, "disable_metrics", "comma-separated list of metrics to be disabled. Options are `disk`, `network`, `tcp`. Note: tcp is disabled by default due to high CPU usage.")
|
|
||||||
// Tcp metrics are ignored by default.
|
|
||||||
flag.Set("disable_metrics", "tcp")
|
|
||||||
}
|
|
||||||
|
|
||||||
type metricSetValue struct {
|
|
||||||
container.MetricSet
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ml *metricSetValue) String() string {
|
|
||||||
return fmt.Sprint(*ml)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ml *metricSetValue) Set(value string) error {
|
|
||||||
for _, metric := range strings.Split(value, ",") {
|
|
||||||
if ignoreWhitelist.Has(container.MetricKind(metric)) {
|
|
||||||
(*ml).Add(container.MetricKind(metric))
|
|
||||||
} else {
|
|
||||||
return fmt.Errorf("unsupported metric %q specified in disable_metrics", metric)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// The Manager interface defines operations for starting a manager and getting
|
// The Manager interface defines operations for starting a manager and getting
|
||||||
// container and machine information.
|
// container and machine information.
|
||||||
type Manager interface {
|
type Manager interface {
|
||||||
@ -155,7 +119,7 @@ type Manager interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// New takes a memory storage and returns a new manager.
|
// New takes a memory storage and returns a new manager.
|
||||||
func New(memoryCache *memory.InMemoryCache, sysfs sysfs.SysFs, maxHousekeepingInterval time.Duration, allowDynamicHousekeeping bool) (Manager, error) {
|
func New(memoryCache *memory.InMemoryCache, sysfs sysfs.SysFs, maxHousekeepingInterval time.Duration, allowDynamicHousekeeping bool, ignoreMetricsSet container.MetricSet) (Manager, error) {
|
||||||
if memoryCache == nil {
|
if memoryCache == nil {
|
||||||
return nil, fmt.Errorf("manager requires memory storage")
|
return nil, fmt.Errorf("manager requires memory storage")
|
||||||
}
|
}
|
||||||
@ -194,7 +158,7 @@ func New(memoryCache *memory.InMemoryCache, sysfs sysfs.SysFs, maxHousekeepingIn
|
|||||||
startupTime: time.Now(),
|
startupTime: time.Now(),
|
||||||
maxHousekeepingInterval: maxHousekeepingInterval,
|
maxHousekeepingInterval: maxHousekeepingInterval,
|
||||||
allowDynamicHousekeeping: allowDynamicHousekeeping,
|
allowDynamicHousekeeping: allowDynamicHousekeeping,
|
||||||
ignoreMetrics: ignoreMetrics.MetricSet,
|
ignoreMetrics: ignoreMetricsSet,
|
||||||
}
|
}
|
||||||
|
|
||||||
machineInfo, err := getMachineInfo(sysfs, fsInfo, inHostNamespace)
|
machineInfo, err := getMachineInfo(sysfs, fsInfo, inHostNamespace)
|
||||||
|
Loading…
Reference in New Issue
Block a user