This is comment for paste
PSBenchFrame - Power Shell Benchmark Framework - PS script performance test
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to Use
- 1. Copy/Import functions you want to test. Add Init-functions if required.
- 2. Populate the Suite: Go to the $Global:TestEntries array and add your blocks. Define a user-friendly Name and wrap your target commands inside the Code = { ... } script block.
- 3. Configure the Chaos Engine:
- - Adjust $Global:SwitchProbabilityPercent to set how often the engine switches tasks in Interlaced mode. Higher values mean shorter, frantic bursts of alternating tasks.
- - Adjust $Global:PauseProbabilityPercent to simulate system hiccups or user idling. You can use values like 0.15 for fine granularity. Or 0 if you don't want any pauses.
- 4. Run the script in a standard PowerShell console window (powershell.exe or pwsh). Avoid VS Code's integrated terminal for best UI rendering accuracy.
- Parameters:
- - ExecutionMode: either "Sequential" if you want to baseline individual commands back-to-back or "Interlaced" if you want to simulate real-world environment context-switching stress.
- - TotalIterations: in "Sequential" mode it defines how mant times each function will be executed and measured. In "Interlaced" mode it's a total number of function calls. Each function will be called and measured more or less as frequent as others. So for 5 functions and 1000 iterations each should be called around 200 times.
- Hope this helps anyone looking to pull highly accurate metrics out of their automated scripts.
Advertisement
Add Comment
Please, Sign In to add comment