Exemplo n.º 1
0
        public void TestProtobuffBandwidth()
        {
            var test = new OutputBandwithTest <ProtoStruct>(
                channel: _channel,
                contract: _proxy,
                dataGenerator: Helper.GenerateProtoStruct,
                sendProcedure: (iterations, packet) =>
            {
                for (int i = 0; i < iterations; i++)
                {
                    _proxy.SayProtoStructEcho(packet);
                }
            });

            _output.WriteLine("Protobuff serialization Test");
            _output.WriteLine("Packet [items]" + OutputBandwithTestResults.GetTabbedHeader());

            MeasureBandWidth(test, 1, 100000);
            MeasureBandWidth(test, 10, 100000);
            MeasureBandWidth(test, 100, 10000);
            MeasureBandWidth(test, 1000, 1000);
            MeasureBandWidth(test, 10000, 100);
            MeasureBandWidth(test, 100000, 10);
            MeasureBandWidth(test, 1000000, 3);
        }