Added PowerShell stress test in Resources dir.

master
Jared Goodwin 2016-07-30 15:44:53 -07:00
parent 9fa48fba90
commit 4feea90c3c
3 changed files with 28 additions and 0 deletions

View File

@ -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" />

View File

@ -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));
}

View File

@ -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":""}]}