Пример #1
0
        public static void Run(string[] args)
        {
            var parserResult = Parser.Default.ParseArguments <ClientOptions>(args)
                               .WithNotParsed((x) => Environment.Exit(1))
                               .WithParsed(options => {
                GrpcPreconditions.CheckArgument(options.NumChannelsPerServer > 0);
                GrpcPreconditions.CheckArgument(options.NumStubsPerChannel > 0);

                var serverAddresses = options.ServerAddresses.Split(',');
                GrpcPreconditions.CheckArgument(serverAddresses.Length > 0, "You need to provide at least one server address");

                var testCases = ParseWeightedTestCases(options.TestCases);
                GrpcPreconditions.CheckArgument(testCases.Count > 0, "You need to provide at least one test case");

                var interopClient = new StressTestClient(options, serverAddresses.ToList(), testCases);
                interopClient.Run().Wait();
            });
        }
Пример #2
0
        public static void Run(string[] args)
        {
            var options = new ClientOptions();
            if (!Parser.Default.ParseArguments(args, options))
            {
                Environment.Exit(1);
            }

            GrpcPreconditions.CheckArgument(options.NumChannelsPerServer > 0);
            GrpcPreconditions.CheckArgument(options.NumStubsPerChannel > 0);

            var serverAddresses = options.ServerAddresses.Split(',');
            GrpcPreconditions.CheckArgument(serverAddresses.Length > 0, "You need to provide at least one server address");

            var testCases = ParseWeightedTestCases(options.TestCases);
            GrpcPreconditions.CheckArgument(testCases.Count > 0, "You need to provide at least one test case");

            var interopClient = new StressTestClient(options, serverAddresses.ToList(), testCases);
            interopClient.Run().Wait();
        }