-
Notifications
You must be signed in to change notification settings - Fork 18
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
add cpu mem stats #192
add cpu mem stats #192
Conversation
ddd0971
to
49c42f0
Compare
Codecov Report
@@ Coverage Diff @@
## main #192 +/- ##
=======================================
Coverage 38.94% 38.94%
=======================================
Files 8 8
Lines 529 529
=======================================
Hits 206 206
Misses 318 318
Partials 5 5
Flags with carried forward coverage won't be shown. Click here to find out more. |
pkg/resource/resource.go
Outdated
func (r *usedResource) GetCPUMem() (uint64, float64) { | ||
r.l.Lock() | ||
defer r.l.Unlock() | ||
return r.mem, r.cpu |
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.
这个 lock 还有用 ?
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.
已取消
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.
这个锁还是要加 要不然会出现读的时候写入
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.
我是指 这样 写的代码 逻辑, return 的值 真的 锁得住么 ?还是脏读
defer 还是在 return 前 就 放锁了
lock
defer unlock
a = r.m
b = r.c
return a,b
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.
done
e37d9c1
to
f001105
Compare
f001105
to
a96fdb2
Compare
(1)PR 描述中,对于新功能要有描述 |
f472a62
to
4a89f7c
Compare
(1)已添加 |
文档中,应该体现这个问题: |
4a89f7c
to
1b0198c
Compare
已添加 |
dd6c4ec
to
b04ee37
Compare
Signed-off-by: ii2day <[email protected]>
b04ee37
to
3befd30
Compare
feature #202
每轮任务报告增加 cpu memory 使用量统计,方便根据测试需求设置 agent 的 resource