Skip to content
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

Merged
merged 4 commits into from
Nov 15, 2019

Conversation

Zyqsempai
Copy link
Contributor

Related to #104
Added memory.current, memory.max, memory.swap.current, memory.swap.max stats.
Signed-off-by: bpopovschi zyqsempai@mail.ru

@Zyqsempai
Copy link
Contributor Author

@AkihiroSuda @crosbymichael PTAL

@estesp
Copy link
Member

estesp commented Nov 14, 2019

I think you will need to rebase on #118 when it is reviewed and merged to get CI passing for all your PRs.

@estesp estesp changed the title Added current and mas swap and memory usage stats Added current and max swap and memory usage stats Nov 14, 2019
v2/stats/metrics.proto Outdated Show resolved Hide resolved
v2/stats/metrics.proto Outdated Show resolved Hide resolved
v2/manager.go Outdated Show resolved Hide resolved
@crosbymichael
Copy link
Member

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>
@codecov-io
Copy link

codecov-io commented Nov 14, 2019

Codecov Report

Merging #117 into master will decrease coverage by 0.29%.
The diff coverage is 0%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
v2/manager.go 0% <0%> (ø) ⬆️
v2/utils.go 9.37% <0%> (-1.06%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d26e1b3...cfc1c23. Read the comment docs.

@Zyqsempai
Copy link
Contributor Author

@crosbymichael Done.

v2/utils.go Outdated Show resolved Hide resolved
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 {
Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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>
@crosbymichael
Copy link
Member

LGTM

@crosbymichael crosbymichael merged commit 2bd4ae1 into containerd:master Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants