mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-06-13 22:48:42 +00:00
a
This commit is contained in:
@@ -12,7 +12,10 @@ public class ThriftTest
|
||||
public static async Task<TestResults> DoTest(string host, int port,
|
||||
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();
|
||||
|
||||
@@ -28,14 +31,14 @@ public class ThriftTest
|
||||
var service = new EchoService.Client(proto);
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -48,7 +51,7 @@ public class ThriftTest
|
||||
// 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}");
|
||||
|
||||
@@ -68,7 +71,7 @@ public class ThriftTest
|
||||
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}");
|
||||
@@ -89,7 +92,7 @@ public class ThriftTest
|
||||
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}");
|
||||
@@ -98,7 +101,7 @@ public class ThriftTest
|
||||
|
||||
}
|
||||
|
||||
await Task.Delay(3000);
|
||||
await Task.Delay(sampleDelayMs);
|
||||
|
||||
(tx, rx) = mon.GetTotals();
|
||||
Console.WriteLine($"Transfer {tx}/{rx}");
|
||||
@@ -108,4 +111,4 @@ public class ThriftTest
|
||||
|
||||
return rt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user