-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b3234d
commit 3fc0339
Showing
2 changed files
with
34 additions
and
6 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,41 @@ | ||
$numbers = [System.Collections.Concurrent.ConcurrentDictionary[string,object]]::new() | ||
|
||
$i = 0 | ||
while ($true) { | ||
$i++ | ||
'https://numberservice-aue.azurewebsites.net/api/numbers/free?diagnostics', 'https://numberservice-ase.azurewebsites.net/api/numbers/free?diagnostics' | ForEach-Object -Parallel { | ||
|
||
$response = $null | ||
$response = Invoke-RestMethod -Method Put -Uri $_ | ||
Write-Host $response.number -ForegroundColor Yellow | ||
Write-Host $response | ||
Write-Host ( $response.CosmosDiagnostics.Context | Where-Object -Property Id -eq 'StoreResponseStatistics' ) | ||
|
||
$numbers = $using:numbers | ||
$numbers[$_] = $response.number | ||
} | ||
|
||
if ($numbers['https://numberservice-aue.azurewebsites.net/api/numbers/free?diagnostics'] -eq $numbers['https://numberservice-ase.azurewebsites.net/api/numbers/free?diagnostics']) { | ||
Write-Host "COLLISION after $i tests" -ForegroundColor Red | ||
Write-Host $numbers['https://numberservice-aue.azurewebsites.net/api/numbers/free?diagnostics'] -ForegroundColor Yellow | ||
Write-Host $numbers['https://numberservice-ase.azurewebsites.net/api/numbers/free?diagnostics'] -ForegroundColor Yellow | ||
break | ||
} | ||
} | ||
|
||
<# | ||
while ($true) { | ||
$response = $null | ||
$response = Invoke-RestMethod -Method Put -Uri 'https://numberservice-aue.azurewebsites.net/api/numbers/free' | ||
$response = $null | ||
$response = Invoke-RestMethod -Method Put -Uri 'https://numberservice-aue.azurewebsites.net/api/numbers/free?diagnostics' | ||
Write-Host $response | ||
Write-Host ( $response.CosmosDiagnostics.Context | Where-Object -Property Id -eq 'StoreResponseStatistics' ) | ||
$response = $null | ||
$response = Invoke-RestMethod -Method Put -Uri 'https://numberservice-ase.azurewebsites.net/api/numbers/free' | ||
|
||
$response = Invoke-RestMethod -Method Put -Uri 'https://numberservice-ase.azurewebsites.net/api/numbers/free?diagnostics' | ||
Write-Host $response | ||
Write-Host ( $response.CosmosDiagnostics.Context | Where-Object -Property Id -eq 'StoreResponseStatistics' ) | ||
#Start-Sleep -Seconds 5 | ||
} | ||
} | ||
#> |