Created
December 4, 2015 15:10
-
-
Save Buthrakaur/376e0c05729ac6969e93 to your computer and use it in GitHub Desktop.
Simple load test tool in powershell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
workflow PingUrlParallel { | |
param( | |
[string]$url, | |
[int]$parallelCount = 10, | |
[int]$iterations = 10 | |
) | |
foreach -parallel ($x in 1..$parallelCount) { | |
1..$iterations | %{ | |
$response = curl $url | |
$status = $response.StatusCode | |
"worker $x : iteration $_ : $status" | |
[System.Threading.Thread]::Sleep(500) | |
} | |
} | |
} | |
PingUrlParallel http://google.com/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment