-
Notifications
You must be signed in to change notification settings - Fork 236
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
Added current and max swap and memory usage stats #117
Added current and max swap and memory usage stats #117
Conversation
I think you will need to rebase on #118 when it is reviewed and merged to get CI passing for all your PRs. |
Can you rebase on master as well to fix the build? Thanks! |
Signed-off-by: bpopovschi <zyqsempai@mail.ru>
Signed-off-by: bpopovschi <zyqsempai@mail.ru>
Signed-off-by: bpopovschi <zyqsempai@mail.ru>
a0dd04b
to
4d88c26
Compare
Codecov Report
@@ Coverage Diff @@
## master #117 +/- ##
=========================================
- Coverage 36.34% 36.05% -0.3%
=========================================
Files 32 32
Lines 2102 2119 +17
=========================================
Hits 764 764
- Misses 1210 1227 +17
Partials 128 128
Continue to review full report at Codecov.
|
@crosbymichael Done. |
v2/utils.go
Outdated
@@ -216,3 +218,24 @@ func ToResources(spec *specs.LinuxResources) *Resources { | |||
} | |||
return &resources | |||
} | |||
|
|||
// Gets uint64 parsed content of single value cgroup stat file | |||
func getStatFileContent(filePath string) 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.
nit: function name is not specific, but it only can retrieve uint64 value.
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.
Also, this should take io.Reader
rather than a filepath string and should have unit tests. Can be a follow-up PR.
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.
Yep, i have in plans to cover everything with unit tests but in separate PR's
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.
Also, I think that io.Reader
parameter here will over complicate using of that function.
Signed-off-by: bpopovschi <zyqsempai@mail.ru>
LGTM |
Related to #104
Added
memory.current, memory.max, memory.swap.current, memory.swap.max
stats.Signed-off-by: bpopovschi zyqsempai@mail.ru