-
Notifications
You must be signed in to change notification settings - Fork 45
Performance of gathering inventory objects #114
Comments
I like the idea of option two as well. I did a little digging to understand a little of how things work behind the scenes. And then move lines 65-76 below $Scopes on line 25. Something like this maybe? |
Sounds pretty good. 😃 |
I did some work and testing around the 'Get' performance, I ended up making too many changes for a single PR, all of those changes are here: https://github.com/jpsider/Vester/blob/Improve-Get-Performance/Vester/Private/Template/VesterTemplate.Tests.ps1 I will be working on the changes that I found to be directly related to performance, and will submit a PR for that. I will also open up some new issues that resulted from the research and testing. Testing numbers : After (Local lab) - 5 vms before - 240 vms after - 240 vms Before (VPN) - 6vms After (VPN) - 6 vms Before (VPN) - 200 vms After (VPN) - 200 vms |
https://gist.github.com/Midacts/91406149a003cb61e8137ec0ff140232 I've discussed these changes in slack, but to reiterate here: TL;DR We then add that object to the main object that will hold the object for all the scopes -> $Final We remove scopes we don't need. Then we loop through every scope
This makes it so the 'gets': Breakdown of changes
After it gets the scope (VM, etc) and the inventory list (the
Everything after line 99 is carry over code |
I have two small edits
This will give the currently desired format for reporting. |
Resolved in #115! |
Invoke-Vester
could be a lot faster. You all are really polite for going this entire month of March trying out New Vester and not commenting on the performance. 😄Currently, when each new test is ready to run, it checks its scope and then pulls the objects it will apply to. So, if a VM test is about to run, part that test's prep is to
Get-VM
and thenForEach
the test against all applicable VMs.This sucks when running the full test suite. For many VM tests in a row, you have to
Get-VM
at the beginning of each one.There are two options:
Get-
all inventory objects once, store them in variables, and pass them into each testI did 1 initially because 2 means even if you're only running Host tests, you still have to
Get-VM
,Get-Cluster
, etc. I'm over caring about that at this point. (and I may be able to weasel around that anyway, haha)The text was updated successfully, but these errors were encountered: