Less racey logic for resource usage

This commit is contained in:
Dane Everitt
2020-12-16 22:03:35 -08:00
parent 0c93e5ed02
commit 3495fb1c76
5 changed files with 23 additions and 48 deletions

View File

@@ -61,7 +61,7 @@ func (e *Environment) pollResources(ctx context.Context) error {
atomic.AddUint64(&tx, nw.RxBytes)
}
st := &environment.Stats{
st := environment.Stats{
Memory: calculateDockerMemory(v.MemoryStats),
MemoryLimit: v.MemoryStats.Limit,
CpuAbsolute: calculateDockerAbsoluteCpu(&v.PreCPUStats, &v.CPUStats),