Skip to content

feat: [ESXi] CPU measurement using esxtop - #4

Merged
mchromin merged 1 commit into
intel:mainfrom
szmijews:cpu_usage_per_vm
Dec 19, 2025
Merged

mchromin merged 1 commit into
intel:mainfrom
szmijews:cpu_usage_per_vm

Conversation

@szmijews

@szmijews szmijews commented Dec 2, 2025 •

Copy link
Copy Markdown
Contributor

Introduce methods for measuring CPU usage with esxtop tool + unit tests
fixes #3

Copilot AI review requested due to automatic review settings December 2, 2025 14:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces CPU measurement functionality for ESXi hosts using the esxtop tool. The implementation allows starting a CPU measurement process, collecting data over time, and parsing the results to calculate average CPU usage for specific VMs.

Key Changes:

  • Added methods to start/stop CPU measurement processes using esxtop command
  • Implemented parsing logic to extract and average CPU usage data from the last 4 samples
  • Added comprehensive unit tests covering normal operation, edge cases, and error handling

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
mfd_host/feature/cpu/esxi.py Implements three new methods for CPU measurement: start, stop, and parse operations with error handling and process management
tests/unit/test_mfd_host/test_feature/test_cpu/test_esxi.py Adds 8 unit tests covering measurement lifecycle, parsing logic, error conditions, and edge cases

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mfd_host/feature/cpu/esxi.py Resolved
Comment thread mfd_host/feature/cpu/esxi.py Resolved
Comment thread mfd_host/feature/cpu/esxi.py Resolved
Comment thread mfd_host/feature/cpu/esxi.py Resolved
@szmijews
szmijews force-pushed the cpu_usage_per_vm branch 2 times, most recently from c50ac5b to 90776eb Compare December 2, 2025 14:06
@szmijews
szmijews requested a review from Copilot December 2, 2025 14:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mfd_host/feature/cpu/esxi.py Resolved
Comment thread mfd_host/feature/cpu/esxi.py Resolved
@szmijews
szmijews requested a review from Copilot December 2, 2025 14:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mfd_host/feature/cpu/esxi.py Resolved
Comment thread mfd_host/feature/cpu/esxi.py Resolved
Comment thread mfd_host/feature/cpu/esxi.py Resolved
@szmijews
szmijews force-pushed the cpu_usage_per_vm branch 2 times, most recently from dd1fd2f to 6facf29 Compare December 4, 2025 17:08
Comment thread mfd_host/feature/cpu/esxi.py Resolved
Comment thread mfd_host/feature/cpu/esxi.py Resolved
mchromin
mchromin previously approved these changes Dec 17, 2025
@adrianlasota adrianlasota reopened this Dec 18, 2025
@adrianlasota adrianlasota changed the title feature: [ESXi] CPU measurement using esxtop feat: [ESXi] CPU measurement using esxtop Dec 18, 2025
@szmijews
szmijews force-pushed the cpu_usage_per_vm branch 2 times, most recently from d995127 to 02a3627 Compare December 19, 2025 08:31
@adrianlasota
adrianlasota requested a review from Copilot December 19, 2025 08:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mfd_host/feature/cpu/esxi.py Resolved
Comment thread mfd_host/feature/cpu/esxi.py Resolved
Comment thread mfd_host/feature/cpu/esxi.py Resolved
Comment thread mfd_host/feature/cpu/esxi.py Resolved
Comment thread mfd_host/feature/cpu/esxi.py Resolved
Comment thread mfd_host/feature/cpu/esxi.py Resolved
Comment thread mfd_host/feature/cpu/esxi.py Resolved
Introduce methods for measuring CPU usage with esxtop tool + unit tests

Signed-off-by: szmijews <szymon.zmijewski@intel.com>
@mchromin
mchromin merged commit be8d42a into intel:main Dec 19, 2025
22 checks passed
@coveralls-official

coveralls-official Bot commented Dec 19, 2025 •

Copy link
Copy Markdown

Coverage Status

coverage: 93.972% (-0.3%) from 94.264%
when pulling d97a497 on szmijews:cpu_usage_per_vm
into 3cb74e3 on intel:main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ESXi] CPU usage measurement

4 participants