2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2026-06-13 22:48:42 +00:00
This commit is contained in:
2026-06-09 01:40:29 +03:00
parent 2bdd5d5022
commit a741013621
19 changed files with 887 additions and 185 deletions
+11 -8
View File
@@ -10,13 +10,16 @@ namespace Esiur.Tests.RPC.Client
public static async Task<TestResults> DoTest(string address,
Dictionary<string, BusinessDocument[]> docsWorkloads,
Dictionary<string, byte[]> dataWorkloads,
Dictionary<string, int[]> intWorkloads )
Dictionary<string, int[]> intWorkloads,
int warmupDelayMs = 3000,
int postHandshakeDelayMs = 2000,
int sampleDelayMs = 3000)
{
var rt = new TestResults();
using var mon = new PerProcessNetMonitor(Process.GetCurrentProcess().Id);
mon.Start();
//mon.Start();
Console.WriteLine($"\n== Esiur @ {address} ==");
@@ -28,13 +31,13 @@ namespace Esiur.Tests.RPC.Client
var sock = service.ResourceConnection.Socket as TcpSocket;
Thread.Sleep(3000);
Thread.Sleep(warmupDelayMs);
var (tx, rx, ctx, crx) = mon.GetDiff(0, 0);
Console.WriteLine($"Handshake {ctx}/{crx}");
await Task.Delay(2000);
await Task.Delay(postHandshakeDelayMs);
foreach (var w in docsWorkloads)
{
@@ -47,7 +50,7 @@ namespace Esiur.Tests.RPC.Client
throw new Exception("No match");
await Task.Delay(3000);
await Task.Delay(sampleDelayMs);
(tx, rx, ctx, crx) = mon.GetDiff(tx, rx);
Console.WriteLine($", {tx}/{rx}, {ctx}/{crx}");
Console.WriteLine($"Socket {sock.BytesSent}/{sock.BytesReceived}");
@@ -67,7 +70,7 @@ namespace Esiur.Tests.RPC.Client
throw new Exception("No match");
await Task.Delay(3000);
await Task.Delay(sampleDelayMs);
(tx, rx, ctx, crx) = mon.GetDiff(tx, rx);
Console.WriteLine($", {tx}/{rx}, {ctx}/{crx}");
Console.WriteLine($"Socket {sock.BytesSent}/{sock.BytesReceived}");
@@ -87,7 +90,7 @@ namespace Esiur.Tests.RPC.Client
throw new Exception("No match");
await Task.Delay(3000);
await Task.Delay(sampleDelayMs);
(tx, rx, ctx, crx) = mon.GetDiff(tx, rx);
Console.WriteLine($", {tx}/{rx}, {ctx}/{crx}");
Console.WriteLine($"Socket {sock.BytesSent}/{sock.BytesReceived}");
@@ -97,7 +100,7 @@ namespace Esiur.Tests.RPC.Client
}
await Task.Delay(3000);
await Task.Delay(sampleDelayMs);
(tx, rx) = mon.GetTotals();
Console.WriteLine($"Transfer {tx}/{rx}");