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

Extending machine API by number of physical cpu cores and cpu sockets #2414

Merged
merged 1 commit into from
Mar 6, 2020

Conversation

katarzyna-z
Copy link
Collaborator

Signed-off-by: Katarzyna Kujawa katarzyna.kujawa@intel.com

Summary of changes:

  • Extended metrics API by number of physical cpu cores (num_physical_cores) and cpu sockets (num_sockets), changes visible on /api/v2.0/machine in following form:
{
    "num_cores": 8,
    "num_physical_cores": 4,
    "num_sockets": 1,
    "cpu_frequency_khz": 4000000,
     ....
}
  • Modified regular expression used for parsing /proc/cpuinfo to get information about core id and physical id to deal with multi line input string without iterating through lines
  • Replaced const cpuBusPath with var cpuBusPath to easily modify sysfs cpu path in tests
  • Added functions to count unique occurrences of CPU properties using regular expressions and reading from sysfs cpu path
  • Extended unit tests to cover introduced changes

Signed-off-by: Katarzyna Kujawa <katarzyna.kujawa@intel.com>
@k8s-ci-robot
Copy link
Collaborator

Hi @katarzyna-z. Thanks for your PR.

I'm waiting for a google member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@iwankgb
Copy link
Collaborator

iwankgb commented Mar 3, 2020

This is related to #2388.

@dashpole dashpole self-assigned this Mar 3, 2020
@dashpole
Copy link
Collaborator

dashpole commented Mar 3, 2020

/ok-to-test

Copy link
Collaborator

@dashpole dashpole left a comment

Choose a reason for hiding this comment

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

lgtm, nice work.

@dashpole dashpole merged commit 7152b60 into google:master Mar 6, 2020
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.

4 participants