Ejemplo n.º 1
0
        private static void RunCustomBenchmark()
        {
            var networkBenchmark = INetworkBenchmark.CreateNetworkBenchmark(BenchmarkCoordinator.Config.Library);

            try
            {
                BenchmarkCoordinator.PrepareBenchmark(networkBenchmark);
                BenchmarkCoordinator.RunBenchmark(networkBenchmark);
            }
            catch (Exception e)
            {
                Console.WriteLine($"Error when running Library {BenchmarkCoordinator.Config.Library}" +
                                  $"\n{e.Message}\n{e.StackTrace}");
            }
            finally
            {
                try
                {
                    BenchmarkCoordinator.CleanupBenchmark(networkBenchmark);
                }
                catch (Exception e)
                {
                    Console.WriteLine($"Error when cleaning up Library {BenchmarkCoordinator.Config.Library}" +
                                      $"\n{e.Message}\n{e.StackTrace}");
                }

                Console.Write(BenchmarkCoordinator.PrintStatistics());
            }
        }
        public void PrepareSamplingBenchmark()
        {
            BenchmarkCoordinator.ApplyPredefinedConfiguration();
            var config = BenchmarkCoordinator.Config;

            config.ParallelMessages = 10;
            config.MessageByteSize  = 128;
            PrepareBenchmark();
        }
        public void PreparePingPongBatchedUnreliable()
        {
            BenchmarkCoordinator.ApplyPredefinedConfiguration();
            var config = BenchmarkCoordinator.Config;

            config.ParallelMessages = 10;
            config.MessageByteSize  = 32;
            config.Transmission     = Transmission;
            PrepareBenchmark();
        }
Ejemplo n.º 4
0
        public void PrepareBenchmark()
        {
            var config = BenchmarkCoordinator.Config;

            config.Benchmark = Mode;
            config.Clients   = Clients;
            config.Library   = LibraryTarget;
            Console.Write(config.ToFormattedString());

            libraryImpl = INetworkBenchmark.CreateNetworkBenchmark(LibraryTarget);
            BenchmarkCoordinator.PrepareBenchmark(libraryImpl);
        }
Ejemplo n.º 5
0
        protected long RunBenchmark()
        {
            var statistics = BenchmarkCoordinator.BenchmarkStatistics;

            BenchmarkCoordinator.StartBenchmark(libraryImpl);
            var receivedMessages = Interlocked.Read(ref statistics.MessagesClientReceived);

            while (receivedMessages < MessageTarget)
            {
                Thread.Sleep(1);
                receivedMessages = Interlocked.Read(ref statistics.MessagesClientReceived);
            }

            BenchmarkCoordinator.StopBenchmark(libraryImpl);
            return(receivedMessages);
        }
        public void PrepareInDepthBenchmark()
        {
            BenchmarkCoordinator.ApplyPredefinedConfiguration();
            var config = BenchmarkCoordinator.Config;

            config.ClientTickRate = TickRate;
            config.ServerTickRate = TickRate;
            config.Address        = Address;
            if (Address != "::1" && Address != "127.0.0.1")
            {
                config.ExecutionMode = ExecutionMode.Client;
            }

            config.ParallelMessages = 1;
            config.MessageByteSize  = 32;
            config.Transmission     = Transmission;
            PrepareBenchmark();
        }
Ejemplo n.º 7
0
 public void CleanupBenchmark()
 {
     BenchmarkCoordinator.CleanupBenchmark(libraryImpl);
 }