Skip to content

Added current and max swap and memory usage stats#117

Merged
crosbymichael merged 4 commits intocontainerd:masterfrom
Zyqsempai:104-add-more-memory-stats
Nov 15, 2019
Merged

Added current and max swap and memory usage stats#117
crosbymichael merged 4 commits intocontainerd:masterfrom
Zyqsempai:104-add-more-memory-stats

Conversation

@Zyqsempai
Copy link
Contributor

Related to #104
Added memory.current, memory.max, memory.swap.current, memory.swap.max stats.
Signed-off-by: bpopovschi [email protected]

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

Can you rebase on master as well to fix the build? Thanks!

@Zyqsempai Zyqsempai force-pushed the 104-add-more-memory-stats branch from a0dd04b to 4d88c26 Compare November 14, 2019 16:10
@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
}

// 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 <[email protected]>
@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.

6 participants