protected override async Task SetupAsync(Arguments args)
        {
            Network = BenchmarkUtil.CreateNodes(NetworkSize, Rnd, 7077, false, false);
            Sender = Network[0];
            Receiver = Network[1];
            Receiver.RawDataReply(new SampleRawDataReply());
            Cc = await Sender.ConnectionBean.Reservation.CreateAsync(IsForceUdp ? 1 : 0, IsForceUdp ? 0 : 1);

            SendDirectBuilder = new SendDirectBuilder(Sender, (PeerAddress)null)
                .SetIdleUdpSeconds(0)
                .SetIdleTcpSeconds(0)
                .SetBuffer(CreateSampleBuffer())
                .SetIsForceUdp(IsForceUdp);
        }
Exemplo n.º 2
0
        private static async Task ExecuteAsync(Arguments args)
        {
            Console.WriteLine("Argument: {0}", args.BmArg);

            double[] results = null;
            switch (args.BmArg)
            {
            case "bootstrap":
                switch (args.Type)
                {
                case "cpu":
                    results = await new BootstrapProfiler().ProfileCpuAsync(args);
                    break;

                case "memory":
                    results = await new BootstrapProfiler().ProfileMemoryAsync(args);
                    break;
                }
                break;

            case "send-local-udp":
                switch (args.Type)
                {
                case "cpu":
                    results = await new SendDirectLocalProfiler(true).ProfileCpuAsync(args);
                    break;

                case "memory":
                    results = await new SendDirectLocalProfiler(true).ProfileMemoryAsync(args);
                    break;
                }
                break;

            case "send-local-tcp":
                switch (args.Type)
                {
                case "cpu":
                    results = await new SendDirectLocalProfiler(false).ProfileCpuAsync(args);
                    break;

                case "memory":
                    results = await new SendDirectLocalProfiler(false).ProfileMemoryAsync(args);
                    break;
                }
                break;

            case "send-remote-udp":
                DetermineServerAddress(args);
                switch (args.Type)
                {
                case "cpu":
                    results = await new SendDirectRemoteProfiler(true).ProfileCpuAsync(args);
                    break;

                case "memory":
                    results = await new SendDirectRemoteProfiler(true).ProfileMemoryAsync(args);
                    break;
                }
                break;

            case "send-remote-tcp":
                DetermineServerAddress(args);
                switch (args.Type)
                {
                case "cpu":
                    results = await new SendDirectRemoteProfiler(false).ProfileCpuAsync(args);
                    break;

                case "memory":
                    results = await new SendDirectRemoteProfiler(false).ProfileMemoryAsync(args);
                    break;
                }
                break;

            default:
                throw new ArgumentException("No valid benchmark argument.");
            }

            PrintResults(results);
            WriteFile(args, results);
        }
Exemplo n.º 3
0
 protected override async Task SetupAsync(Arguments args)
 {
     Network = BenchmarkUtil.CreateNodes(NetworkSize, Rnd, 7077, false, false);
 }