Last active
November 11, 2016 09:05
-
-
Save nordineb/cbff6341bb4f44c3390e15f901934f45 to your computer and use it in GitHub Desktop.
This file contains 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
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} | |
[System.Net.ServicePointManager]::Expect100Continue = {$false} | |
[System.Net.ServicePointManager]::CheckCertificateRevocationList = $true; | |
[System.Net.ServicePointManager]::DefaultConnectionLimit = 1000; | |
[System.Net.ServicePointManager]::MaxServicePoints = 1000; | |
[System.Net.ServicePointManager]::ReusePort = $true; | |
[System.Net.ServicePointManager]::UseNagleAlgorithm = $false; | |
[System.Net.ServicePointManager]::EnableDnsRoundRobin = $false; | |
$url = "https://data-nsr.udir.no" | |
$enheter = Invoke-RestMethod -Uri "$url/enheter" -DisableKeepAlive | |
$n = 1; | |
$sw = [Diagnostics.Stopwatch]::StartNew() | |
foreach($e in $enheter) | |
{ | |
If ($n -ge 1000) { break; } | |
$id = $e.NSRId | |
$enhet = Invoke-WebRequest -Uri "$url/enhet/$id" | |
$n++; | |
} | |
$sw.stop(); | |
"Thoughput: $($n/$sw.Elapsed.TotalSeconds) enheter/sek." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment