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

Collect nydusd startup cpu utilization and report its mem usage #279

Merged
merged 6 commits into from
Dec 14, 2022

Conversation

changweige
Copy link
Member

@changweige changweige commented Dec 10, 2022

Collect some metrics about nydusd system resource consumption during its startup procedure.
It will be helpful when analyze application startup latency

@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2022

Codecov Report

Base: 33.30% // Head: 33.06% // Decreases project coverage by -0.23% ⚠️

Coverage data is based on head (0662489) compared to base (da9408a).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #279      +/-   ##
==========================================
- Coverage   33.30%   33.06%   -0.24%     
==========================================
  Files          29       29              
  Lines        3129     3151      +22     
==========================================
  Hits         1042     1042              
- Misses       1979     2001      +22     
  Partials      108      108              
Impacted Files Coverage Δ
pkg/daemon/daemon.go 0.00% <ø> (ø)
pkg/manager/daemon_adaptor.go 0.00% <0.00%> (ø)
pkg/system/system.go 5.96% <0.00%> (-0.38%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@changweige changweige force-pushed the nydusd-cpu-resouces branch 5 times, most recently from 916878e to 0662489 Compare December 12, 2022 03:47
@sctb512
Copy link
Member

sctb512 commented Dec 13, 2022

Moreover, LGTM.

@@ -32,27 +33,48 @@ var (
PageSize = GetPageSize()
)

func GetCurrentStat(pid int) (*Stat, error) {
func CalculateCPUUtilization(begin *Stat, now *Stat) float64 {
cpuSys := (now.Stime - begin.Stime) / ClkTck
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should check whether the begin and now are not nil before using them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
@changweige
Copy link
Member Author

@sctb512 Mind take another look?

@changweige changweige merged commit 3d0e02d into containerd:main Dec 14, 2022
@changweige changweige deleted the nydusd-cpu-resouces branch January 18, 2023 01:58
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.

3 participants