-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#4375 - use memory usage without memory cache #4383
#4375 - use memory usage without memory cache #4383
Conversation
@@ -41,8 +41,8 @@ func calculateCPUPercentWindows(v *types.StatsJSON) float64 { | |||
|
|||
// calculateMemUsageUnixNoCache calculate memory usage of the container. | |||
// Page cache is intentionally excluded to avoid misinterpretation of the output. | |||
func calculateMemUsageUnixNoCache(mem types.MemoryStats) float64 { | |||
return float64(mem.Usage - mem.Stats["cache"]) | |||
func calculateMemUsageUnixNoCache(mem types.MemoryStats) uint64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielnelson may need to weigh in, but I believe changing types isn't supported in certain outputs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true but in this case I believe the field types are retained: usage
is a uint64 and usage_percent
is a float64. I think it would be nice to leave this function returning a float64 though so that our code is closer to the upstream code, and then convert to an uint64 just for the usage field.
Gopkg.lock
Outdated
@@ -413,6 +413,217 @@ | |||
] | |||
revision = "c43482518d410361b6c383d7aebce33d0471d7bc" | |||
|
|||
[[projects]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to this file should be removed.
3e23835
to
4c9603d
Compare
(cherry picked from commit 4c27862)
very good 👍 |
closes #4375
Required for all PRs: