From cf1ee6c694ec873c3a408047546da2e517496d9f Mon Sep 17 00:00:00 2001 From: "Tim St. Clair" Date: Wed, 8 Jun 2016 11:57:20 -0700 Subject: [PATCH] Bump cAdvisor to v0.23.3 --- Godeps/Godeps.json | 162 +++++++++--------- .../collector/prometheus_collector.go | 12 +- vendor/github.com/google/cadvisor/fs/fs.go | 22 +++ .../google/cadvisor/version/VERSION | 2 +- 4 files changed, 113 insertions(+), 85 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 51e30ab41a9..9a9194490eb 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1,7 +1,7 @@ { "ImportPath": "k8s.io/kubernetes", "GoVersion": "go1.6", - "GodepVersion": "v68", + "GodepVersion": "v69", "Packages": [ "github.com/ugorji/go/codec/codecgen", "github.com/onsi/ginkgo/ginkgo", @@ -922,203 +922,203 @@ }, { "ImportPath": "github.com/google/cadvisor/api", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/cache/memory", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/collector", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/container", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/container/common", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/container/docker", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/container/libcontainer", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/container/raw", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/container/rkt", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/container/systemd", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/devicemapper", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/events", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/fs", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/healthz", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/http", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/http/mux", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/info/v1", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/info/v1/test", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/info/v2", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/machine", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/manager", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/manager/watcher", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/manager/watcher/raw", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/manager/watcher/rkt", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/metrics", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/pages", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/pages/static", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/storage", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/summary", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/utils", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/utils/cloudinfo", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/utils/cpuload", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/utils/cpuload/netlink", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/utils/docker", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/utils/oomparser", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/utils/sysfs", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/utils/sysinfo", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/utils/tail", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/validate", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/cadvisor/version", - "Comment": "v0.23.2", - "Rev": "7ddf6eb5d1f84363fbc181a498313a880b12ba07" + "Comment": "v0.23.3", + "Rev": "6607e7cf50dfc2ef115f5099c6246e3384fbc9a7" }, { "ImportPath": "github.com/google/gofuzz", diff --git a/vendor/github.com/google/cadvisor/collector/prometheus_collector.go b/vendor/github.com/google/cadvisor/collector/prometheus_collector.go index 03707f11ca1..0022d026f09 100644 --- a/vendor/github.com/google/cadvisor/collector/prometheus_collector.go +++ b/vendor/github.com/google/cadvisor/collector/prometheus_collector.go @@ -120,12 +120,18 @@ func (collector *PrometheusCollector) GetSpec() []v1.MetricSpec { } lines := strings.Split(string(pageContent), "\n") + lineCount := len(lines) for i, line := range lines { if strings.HasPrefix(line, "# HELP") { - stopIndex := strings.Index(lines[i+2], "{") - if stopIndex == -1 { - stopIndex = strings.Index(lines[i+2], " ") + if i+2 >= lineCount { + break } + + stopIndex := strings.IndexAny(lines[i+2], "{ ") + if stopIndex == -1 { + continue + } + name := strings.TrimSpace(lines[i+2][0:stopIndex]) if _, ok := collector.metricsSet[name]; collector.metricsSet != nil && !ok { continue diff --git a/vendor/github.com/google/cadvisor/fs/fs.go b/vendor/github.com/google/cadvisor/fs/fs.go index 75e3abd4f83..dafc7bf70b1 100644 --- a/vendor/github.com/google/cadvisor/fs/fs.go +++ b/vendor/github.com/google/cadvisor/fs/fs.go @@ -44,6 +44,26 @@ const ( LabelRktImages = "rkt-images" ) +// The maximum number of `du` tasks that can be running at once. +const maxConsecutiveDus = 20 + +// A pool for restricting the number of consecutive `du` tasks running. +var duPool = make(chan struct{}, maxConsecutiveDus) + +func init() { + for i := 0; i < maxConsecutiveDus; i++ { + releaseDuToken() + } +} + +func claimDuToken() { + <-duPool +} + +func releaseDuToken() { + duPool <- struct{}{} +} + type partition struct { mountpoint string major uint @@ -391,6 +411,8 @@ func (self *RealFsInfo) GetDirUsage(dir string, timeout time.Duration) (uint64, if dir == "" { return 0, fmt.Errorf("invalid directory") } + claimDuToken() + defer releaseDuToken() cmd := exec.Command("nice", "-n", "19", "du", "-s", dir) stdoutp, err := cmd.StdoutPipe() if err != nil { diff --git a/vendor/github.com/google/cadvisor/version/VERSION b/vendor/github.com/google/cadvisor/version/VERSION index fda96dcf630..9e40e75c5d2 100644 --- a/vendor/github.com/google/cadvisor/version/VERSION +++ b/vendor/github.com/google/cadvisor/version/VERSION @@ -1 +1 @@ -0.23.2 +0.23.3