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
+29 -29
View File
@@ -15,8 +15,8 @@ public class GrpcTest
public static async Task<TestResults> DoTest(string address,
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)
@@ -63,50 +63,50 @@ public class GrpcTest
foreach (var w in dataWorkloads)
{
Console.Write("Bytes Workload: " + w.Key);
//foreach (var w in dataWorkloads)
//{
// Console.Write("Bytes Workload: " + w.Key);
var br = new BytesRequest() { Data = ByteString.CopyFrom(w.Value) };
var res = await service.EchoBytesAsync(br);
// var br = new BytesRequest() { Data = ByteString.CopyFrom(w.Value) };
// var res = await service.EchoBytesAsync(br);
//if (!w.Value.SequenceEqual(rt))
// throw new Exception("No match");
// //if (!w.Value.SequenceEqual(rt))
// // 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 ir = new IntArrayRequest();
ir.Array.AddRange(w.Value);
// var ir = new IntArrayRequest();
// ir.Array.AddRange(w.Value);
var res = await service.EchoIntArrayAsync(ir);
// var res = await service.EchoIntArrayAsync(ir);
//if (!w.Value.SequenceEqual(rt))
// throw new Exception("No match");
// //if (!w.Value.SequenceEqual(rt))
// // 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);