Commit 418c7292 authored by k8s-merge-robot's avatar k8s-merge-robot

Merge pull request #18486 from timstclair/kubelet_stats

Auto commit by PR queue bot
parents bae050ff 2e6ef04a
...@@ -607,8 +607,13 @@ func (r *resourceCollector) collectStats(oldStats map[string]*cadvisorapi.Contai ...@@ -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) Logf("Missing info/stats for container %q on node %q", name, r.node)
return return
} }
if _, ok := oldStats[name]; ok { if oldInfo, ok := oldStats[name]; ok {
r.buffers[name] = append(r.buffers[name], computeContainerResourceUsage(name, oldStats[name], info.Stats[0])) 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] oldStats[name] = info.Stats[0]
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment