Skip to content

Instantly share code, notes, and snippets.

@MudassarAli
Forked from Buthrakaur/PingUrlParallel.ps1
Created September 11, 2018 08:49
Show Gist options
  • Save MudassarAli/b9646ff1f8898655cb60f994356b01d3 to your computer and use it in GitHub Desktop.
Save MudassarAli/b9646ff1f8898655cb60f994356b01d3 to your computer and use it in GitHub Desktop.
Simple load test tool in powershell
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