Bump cAdvisor to v0.23.3
This commit is contained in:
12
vendor/github.com/google/cadvisor/collector/prometheus_collector.go
generated
vendored
12
vendor/github.com/google/cadvisor/collector/prometheus_collector.go
generated
vendored
@@ -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
|
||||
|
22
vendor/github.com/google/cadvisor/fs/fs.go
generated
vendored
22
vendor/github.com/google/cadvisor/fs/fs.go
generated
vendored
@@ -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 {
|
||||
|
2
vendor/github.com/google/cadvisor/version/VERSION
generated
vendored
2
vendor/github.com/google/cadvisor/version/VERSION
generated
vendored
@@ -1 +1 @@
|
||||
0.23.2
|
||||
0.23.3
|
||||
|
Reference in New Issue
Block a user