public void MeasureBandwidth() { var test = new TransactionBandwithTest <byte[]>( channel: _channel, contract: _proxy, dataGenerator: Helper.GenerateArray, sendProcedure: (iterations, packet) => { for (int i = 0; i < iterations; i++) { _proxy.AskBytesEcho(packet); } }); _output.WriteLine("Bandwidth Test"); _output.WriteLine("packet [bytes]\t speed [megaBytes per sec]"); Measure(test, 1, 10000); Measure(test, 100, 10000); Measure(test, 1000, 10000); Measure(test, 60000, 1000); Measure(test, 100000, 1000); Measure(test, 500000, 500); Measure(test, 1000000, 50); }
void Measure <T>(TransactionBandwithTest <T> test, int items, int iterationsCount) { var results = test.Test(items, iterationsCount); _output.WriteLine( $"{items:000000} \t{results.TotalBandwidthMbs:0.0}"); }