Exclude cached memory on docker input plugin (#4383)
This commit is contained in:
parent
f363e70f33
commit
4c2786298d
|
@ -534,11 +534,11 @@ func parseContainerStats(
|
|||
|
||||
if daemonOSType != "windows" {
|
||||
memfields["limit"] = stat.MemoryStats.Limit
|
||||
memfields["usage"] = stat.MemoryStats.Usage
|
||||
memfields["max_usage"] = stat.MemoryStats.MaxUsage
|
||||
|
||||
mem := calculateMemUsageUnixNoCache(stat.MemoryStats)
|
||||
memLimit := float64(stat.MemoryStats.Limit)
|
||||
memfields["usage"] = uint64(mem)
|
||||
memfields["usage_percent"] = calculateMemPercentUnixNoCache(memLimit, mem)
|
||||
} else {
|
||||
memfields["commit_bytes"] = stat.MemoryStats.Commit
|
||||
|
|
Loading…
Reference in New Issue