Update cAdvisor.

Also update golang.org/x/sys because of google/cadvisor#1786
This commit is contained in:
Rohit Agarwal
2017-11-06 13:54:48 -08:00
parent dad41f8526
commit fe5ef1b494
297 changed files with 10024 additions and 8974 deletions

View File

@@ -29,6 +29,7 @@ import (
"sync"
"time"
"github.com/google/cadvisor/accelerators"
"github.com/google/cadvisor/cache/memory"
"github.com/google/cadvisor/collector"
"github.com/google/cadvisor/container"
@@ -78,6 +79,9 @@ type containerData struct {
// Runs custom metric collectors.
collectorManager collector.CollectorManager
// nvidiaCollector updates stats for Nvidia GPUs attached to the container.
nvidiaCollector accelerators.AcceleratorCollector
}
// jitter returns a time.Duration between duration and duration + maxFactor * duration,
@@ -557,6 +561,12 @@ func (c *containerData) updateStats() error {
}
}
var nvidiaStatsErr error
if c.nvidiaCollector != nil {
// This updates the Accelerators field of the stats struct
nvidiaStatsErr = c.nvidiaCollector.UpdateStats(stats)
}
ref, err := c.handler.ContainerReference()
if err != nil {
// Ignore errors if the container is dead.
@@ -572,6 +582,9 @@ func (c *containerData) updateStats() error {
if statsErr != nil {
return statsErr
}
if nvidiaStatsErr != nil {
return nvidiaStatsErr
}
return customStatsErr
}