Skip to content

Conversation

zyy17
Copy link
Collaborator

@zyy17 zyy17 commented Oct 2, 2025

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?

  1. Add get_total_cpu_millicores() / get_total_cpu_cores() / get_total_memory_bytes() / get_total_memory_readable() in common-stat to unify the API of getting total CPU and memory.

    • The original implementation by using num_cpus::get() can not handle the non-integer cgroups cpu limit(for example, 1500m);
  2. Breaking changes in information_schema.cluster_info table:

    • cpus -> total_cpu_millicores(use the millicores as the basic unit)
    • memory_bytes -> total_memory_bytes

PR Checklist

Please convert it to a draft if some of the following conditions are not met.

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR requires documentation updates.
  • API changes are backward compatible.
  • Schema or data changes are backward compatible.

@zyy17 zyy17 requested review from a team, evenyag, v0y4g3r, waynexia and zhongzc as code owners October 2, 2025 14:39
@github-actions github-actions bot added size/M breaking-change This pull request contains breaking changes. docs-not-required This change does not impact docs. labels Oct 2, 2025
@zyy17 zyy17 requested a review from MichaelScofield as a code owner October 2, 2025 15:01
@sunng87
Copy link
Member

sunng87 commented Oct 2, 2025

@zyy17 I already have typo fixes in #7047
We can merge that standalone pr first.

…/ `get_total_memory_bytes()` / `get_total_memory_readable()` in common-stat

Signed-off-by: zyy17 <[email protected]>
@zyy17 zyy17 force-pushed the refactor/get-total-cpu-memory branch from efeff57 to 36827af Compare October 2, 2025 16:03
@zyy17 zyy17 requested a review from MichaelScofield October 16, 2025 07:16
@zyy17 zyy17 added this pull request to the merge queue Oct 16, 2025
Merged via the queue into GreptimeTeam:main with commit cf1b839 Oct 16, 2025
42 checks passed
@zyy17 zyy17 deleted the refactor/get-total-cpu-memory branch October 16, 2025 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change This pull request contains breaking changes. docs-not-required This change does not impact docs. size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants