mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Merge pull request #18486 from timstclair/kubelet_stats
Auto commit by PR queue bot
This commit is contained in:
commit
418c729240
@ -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]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user