Merge pull request #18486 from timstclair/kubelet_stats

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot 2015-12-16 13:23:40 -08:00
commit 418c729240

View File

@ -607,8 +607,13 @@ func (r *resourceCollector) collectStats(oldStats map[string]*cadvisorapi.Contai
Logf("Missing info/stats for container %q on node %q", name, r.node)
return
}
if _, ok := oldStats[name]; ok {
r.buffers[name] = append(r.buffers[name], computeContainerResourceUsage(name, oldStats[name], info.Stats[0]))
if oldInfo, ok := oldStats[name]; ok {
newInfo := info.Stats[0]
if oldInfo.Timestamp.Equal(newInfo.Timestamp) {
// No change -> skip this stat.
continue
}
r.buffers[name] = append(r.buffers[name], computeContainerResourceUsage(name, oldInfo, newInfo))
}
oldStats[name] = info.Stats[0]
}