MaxKK
May 30th, 2026
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. How to Use
  2. 1. Copy/Import functions you want to test. Add Init-functions if required.
  3. 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.
  4. 3. Configure the Chaos Engine:
  5. - Adjust $Global:SwitchProbabilityPercent to set how often the engine switches tasks in Interlaced mode. Higher values mean shorter, frantic bursts of alternating tasks.
  6. - 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.
  7. 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.
  8. Parameters:
  9. - 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.
  10. - 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.
  11.  
  12. Hope this helps anyone looking to pull highly accurate metrics out of their automated scripts.
Advertisement
Add Comment
Please, Sign In to add comment