combine container.Stats and container.PrevContainerStats

This commit is contained in:
Henry Dollman
2024-09-28 18:51:46 -04:00
parent 73d0dd25ec
commit 9637363cf3
5 changed files with 84 additions and 80 deletions

View File

@@ -12,9 +12,9 @@ func (a *Agent) releaseSemaphore() {
// delete container stats from map using mutex
func (a *Agent) deleteContainerStatsSync(id string) {
a.prevContainerStatsMutex.Lock()
defer a.prevContainerStatsMutex.Unlock()
delete(a.prevContainerStatsMap, id)
a.containerStatsMutex.Lock()
defer a.containerStatsMutex.Unlock()
delete(a.containerStatsMap, id)
}
func bytesToMegabytes(b float64) float64 {