mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 01:06:27 +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)
|
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]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user