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

add cpu mem stats #192

Merged
merged 1 commit into from
Sep 21, 2023
Merged

add cpu mem stats #192

merged 1 commit into from
Sep 21, 2023

Conversation

ii2day
Copy link
Collaborator

@ii2day ii2day commented Sep 11, 2023

feature #202
每轮任务报告增加 cpu memory 使用量统计,方便根据测试需求设置 agent 的 resource

@ii2day ii2day requested a review from weizhoublue as a code owner September 11, 2023 11:08
@ii2day
Copy link
Collaborator Author

ii2day commented Sep 11, 2023

image

@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Merging #192 (3befd30) into main (5352940) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #192   +/-   ##
=======================================
  Coverage   38.94%   38.94%           
=======================================
  Files           8        8           
  Lines         529      529           
=======================================
  Hits          206      206           
  Misses        318      318           
  Partials        5        5           
Flag Coverage Δ
unittests 38.94% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

func (r *usedResource) GetCPUMem() (uint64, float64) {
r.l.Lock()
defer r.l.Unlock()
return r.mem, r.cpu
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个 lock 还有用 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

已取消

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

这个锁还是要加 要不然会出现读的时候写入

Copy link
Collaborator

@weizhoublue weizhoublue Sep 20, 2023

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@weizhoublue
Copy link
Collaborator

weizhoublue commented Sep 14, 2023

(1)PR 描述中,对于新功能要有描述
(2)不需要有任何 doc 修改么
(3)没有用例么

@ii2day ii2day force-pushed the pr/ii2day/resource branch 2 times, most recently from f472a62 to 4a89f7c Compare September 14, 2023 03:11
@ii2day
Copy link
Collaborator Author

ii2day commented Sep 14, 2023

(1)PR 描述中,对于新功能要有描述 (2)不需要有任何 doc 修改么 (3)没有用例么

(1)已添加
(2)doc 中报告 cpu mem 部分已添加
(3)还没有用例

@weizhoublue
Copy link
Collaborator

文档中,应该体现这个问题:
每个task 创建的 deployment 等,如果 访问成功率 不符合预期,可关注下 maxCPU 等指标,以确保 不是 cpu 等资源导致的 压测数据不准

@ii2day
Copy link
Collaborator Author

ii2day commented Sep 19, 2023

文档中,应该体现这个问题: 每个task 创建的 deployment 等,如果 访问成功率 不符合预期,可关注下 maxCPU 等指标,以确保 不是 cpu 等资源导致的 压测数据不准

已添加

@ii2day ii2day force-pushed the pr/ii2day/resource branch 2 times, most recently from dd6c4ec to b04ee37 Compare September 21, 2023 01:47
Signed-off-by: ii2day <[email protected]>
@weizhoublue weizhoublue merged commit 67c6bf7 into main Sep 21, 2023
@weizhoublue weizhoublue deleted the pr/ii2day/resource branch September 21, 2023 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants