Added PowerShell stress test in Resources dir.
parent
9fa48fba90
commit
4feea90c3c
|
@ -134,6 +134,8 @@
|
|||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
<None Include="Resources\EBS Stress Test.ps1" />
|
||||
<None Include="Resources\Test.data" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
Clear-Host
|
||||
|
||||
$ClientList = [System.Collections.ArrayList]::new();
|
||||
|
||||
for ($i = 0; $i -lt 500; $i++)
|
||||
{
|
||||
$newClient = [System.Net.Sockets.TcpClient]::new();
|
||||
$newClient.Connect($env:COMPUTERNAME, 33885);
|
||||
$newClient.Client.Send([System.Text.Encoding]::UTF8.GetBytes("Client$i")) | Out-Null;
|
||||
$ClientList.Add($newClient) | Out-Null;
|
||||
}
|
||||
|
||||
$ObservedClient = $ClientList[[Math]::Round($ClientList.Count / 2, 0)];
|
||||
|
||||
while ($ObservedClient.Connected)
|
||||
{
|
||||
while ($ObservedClient.Available -eq 0)
|
||||
{
|
||||
Write-Host "Waiting for data...";
|
||||
Start-Sleep -Milliseconds 500;
|
||||
}
|
||||
$buffer = New-Object Byte[] $ObservedClient.Available;
|
||||
$ObservedClient.Client.Receive($buffer);
|
||||
Write-Host ([System.Text.Encoding]::UTF8.GetString($buffer));
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{"HostIP":"","HostName":"OPTIMUS","WorkerList":[{"Name":"Jared","Notes":" Doing some stuff. I'm typing some words."},{"Name":"Sean","Notes":"Typing notes. Wow. Instant messaging. INSTANT!"},{"Name":"Dane","Notes":""}]}
|
Loading…
Reference in New Issue