-
Notifications
You must be signed in to change notification settings - Fork 325
Get-VIEventPlus taking a long time on vCenter 8.0u3 and later #767
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: master
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThe Get-VIEventPlus function was taking a long time to execute on vCenter 8.0u3 and later due to retrieving events one by one. To address this, the code was modified to retrieve events in larger batches, significantly improving performance. The number of events retrieved per call was increased from 100 to 1000, and a loop was added to process these batches. No diagrams generated as the changes look simple and do not need a visual representation. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @adam-ahern - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a comment explaining why the event number was increased to 1000.
- It might be worth extracting the event processing logic into a separate function for better readability.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
Tested in my homelab with good results! |
Issue was reported in #766
I was able to reproduce the issue in an 8.0u3 lab using PowerCLI 13.3
Running the vCheck script with Trace set to 1 showed the Get-VIEventPlus going into a long loop to add events to a list checking through each event 1 by 1.
vCheck-vSphere/Plugins/00 Initialize/00 Connection Plugin for vCenter.ps1
Lines 465 to 472 in e248cf2
I added code to retrieve more events at a time, and process them in larger batches
Summary by Sourcery
Bug Fixes: