mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
kubelet/stats: fix pid stats for cadvisor stats provider
the process stats aren't correct coming from only the pod stats. They need to be summed for all of the containers, as cadvisor is only reading per pid (per container process) Signed-off-by: Peter Hunt <pehunt@redhat.com>
This commit is contained in:
parent
7d8ba7849b
commit
5fd7219cf4
@ -139,6 +139,8 @@ func (p *cadvisorStatsProvider) ListPodStats(_ context.Context) ([]statsapi.PodS
|
||||
}
|
||||
podStats.Containers = append(podStats.Containers, *containerStat)
|
||||
}
|
||||
// Either way, collect process stats
|
||||
podStats.ProcessStats = mergeProcessStats(podStats.ProcessStats, cadvisorInfoToProcessStats(&cinfo))
|
||||
}
|
||||
|
||||
// Add each PodStats to the result.
|
||||
@ -154,7 +156,7 @@ func (p *cadvisorStatsProvider) ListPodStats(_ context.Context) ([]statsapi.PodS
|
||||
podStats.CPU = cpu
|
||||
podStats.Memory = memory
|
||||
podStats.Swap = cadvisorInfoToSwapStats(podInfo)
|
||||
podStats.ProcessStats = cadvisorInfoToProcessStats(podInfo)
|
||||
// ProcessStats were accumulated as the containers were iterated.
|
||||
}
|
||||
|
||||
status, found := p.statusProvider.GetPodStatus(podUID)
|
||||
|
Loading…
Reference in New Issue
Block a user