Exemplo n.º 1
0
        static void RunLatencyBenchmark(ProgramOptionSet optionSet)
        {
            var messageLatencyOptionSet = new ThroughputOptionSet();

            messageLatencyOptionSet.Parse(_remaining);

            IThroughputSettings settings = messageLatencyOptionSet;

            var benchmark = new ThroughputBenchmark(settings);

            benchmark.Run(CancellationToken.None);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Green Pipes Benchmark");
            Console.WriteLine();

            var optionSet = new ProgramOptionSet();

            try
            {
                _remaining = optionSet.Parse(args);

                if (optionSet.Help)
                {
                    ShowHelp(optionSet);
                    return;
                }

                optionSet.ShowOptions();

                if (optionSet.Benchmark.HasFlag(ProgramOptionSet.BenchmarkOptions.Latency))
                {
                    RunLatencyBenchmark(optionSet);
                }

                if (Debugger.IsAttached)
                {
                    Console.Write("Press any key to continue...");
                    Console.ReadKey();
                }
            }
            catch (OptionException ex)
            {
                Console.Write("gpbench: ");
                Console.WriteLine(ex.Message);
                Console.WriteLine("Use 'gpbench --help' for detailed usage information.");
            }
        }