2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2026-06-13 22:48:42 +00:00

ProxyTypes

This commit is contained in:
2026-06-09 20:56:01 +03:00
parent 64282684b9
commit 2f39aabf7e
11 changed files with 652 additions and 202 deletions
+26 -26
View File
@@ -11,8 +11,8 @@ 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, byte[]> dataWorkloads,
//Dictionary<string, int[]> intWorkloads,
int warmupDelayMs = 3000,
int postHandshakeDelayMs = 2000,
int sampleDelayMs = 3000)
@@ -60,46 +60,46 @@ public class ThriftTest
foreach (var w in dataWorkloads)
{
Console.Write("Bytes Workload: " + w.Key);
//foreach (var w in dataWorkloads)
//{
// Console.Write("Bytes Workload: " + w.Key);
var res = await service.EchoBytes(w.Value);
// var res = await service.EchoBytes(w.Value);
if (!w.Value.SequenceEqual(res))
throw new Exception("No match");
// if (!w.Value.SequenceEqual(res))
// throw new Exception("No match");
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}");
// 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}");
rt.Bytes.Add(w.Key, (ctx, crx));
// rt.Bytes.Add(w.Key, (ctx, crx));
}
//}
foreach (var w in intWorkloads)
{
Console.Write("Ints Workload: " + w.Key);
//foreach (var w in intWorkloads)
//{
// Console.Write("Ints Workload: " + w.Key);
var res = await service.EchoIntArray(w.Value.ToList());
// var res = await service.EchoIntArray(w.Value.ToList());
if (!w.Value.SequenceEqual(res))
throw new Exception("No match");
// if (!w.Value.SequenceEqual(res))
// throw new Exception("No match");
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}");
// 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}");
rt.Ints.Add(w.Key, (ctx, crx));
// rt.Ints.Add(w.Key, (ctx, crx));
}
//}
await Task.Delay(sampleDelayMs);