-
Notifications
You must be signed in to change notification settings - Fork 419
feat: add cpu_usage_millicores
and memory_usage_bytes
in information_schema.cluster_info
table.
#7051
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: zyy17 <[email protected]>
Signed-off-by: zyy17 <[email protected]>
feat: enable zstd in bulk memtable Signed-off-by: evenyag <[email protected]>
…/ `get_total_memory_bytes()` / `get_total_memory_readable()` in common-stat Signed-off-by: zyy17 <[email protected]>
fc11f81
to
9cb8633
Compare
…tion_schema.cluster_info` table Signed-off-by: zyy17 <[email protected]>
9cb8633
to
bfbebb8
Compare
cpu_usage_millicores
and memory_usage_bytes
in information_schema.cluster_info
table.cpu_usage_millicores
and memory_usage_bytes
in information_schema.cluster_info
table.
Signed-off-by: zyy17 <[email protected]>
8628422
to
472b85c
Compare
Signed-off-by: zyy17 <[email protected]>
472b85c
to
5ab40a9
Compare
(PEER_HOSTNAME, &Value::from(node_info.hostname.as_str())), | ||
(VERSION, &Value::from(node_info.version.as_str())), | ||
(GIT_COMMIT, &Value::from(node_info.git_commit.as_str())), | ||
(PEER_HOSTNAME, &Value::from(node_info.hostname.as_str())), |
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.
Is there a repeated assignment? See line 236.
if let Some(current_cpu_usage_usecs) = current_cpu_usage_usecs { | ||
let cpu_usage = calculate_cpu_usage( | ||
current_cpu_usage_usecs, | ||
last_cpu_usage_usecs.load(Ordering::Relaxed), |
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.
In the first loop, last_cpu_usage_usecs
is 0. calculate_cpu_usage(current, 0, interval) calculates the average CPU usage from boot to now, which is meaningless. The baseline should only be recorded on the first time, and calculations should start from the second time.
cpu_usage_millicores: 0, | ||
memory_usage_bytes: 0, |
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.
Should we store only non-zero values on metasrv, or let resource_stat
cache the statistics for each window?
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
What's changed and what's your intention?
Wait for GreptimeTeam/greptime-proto#284.
Add
cpu_usage_millicores
andmemory_usage_bytes
ininformation_schema.cluster_info
table:With this information, we can easily calculate the total resource usage and may use it to make other decisions about whether to run the high-resource-intensive operation or not.
For now, it only works for a containerized environment.
PR Checklist
Please convert it to a draft if some of the following conditions are not met.