Пример #1
0
        public CounterCaptureCommand(ILogger logger)
            : base("counter", "capture the counters in parameter")
        {
            AddOption(OptionHelper.CreateOption <string>("--serviceId", isRequired: true));
            AddOption(OptionHelper.CreateOption <string>("--clusterId", isRequired: true));
            AddOption(OptionHelper.CreateOption("--secretSource", defaultValue: SecretConfiguration.SecretSource.File));
            AddOption(OptionHelper.CreateOption <string>("--counterKey", defaultValue: StreamingConstants.DefaultCounterGrain));
            AddArgument(new Argument <List <string> >("Counters")
            {
                Arity = ArgumentArity.OneOrMore
            });

            Handler = CommandHandler.Create <Parameters>(RunAsync);
            _logger = logger;
        }
Пример #2
0
        public ChaosAgentCommand(ILogger logger)
            : base("chaosagent", "Shutdown/restart servers gracefully or not")
        {
            AddOption(OptionHelper.CreateOption <string>("--serviceId", isRequired: true));
            AddOption(OptionHelper.CreateOption <string>("--clusterId", isRequired: true));
            AddOption(OptionHelper.CreateOption("--secretSource", defaultValue: SecretConfiguration.SecretSource.File));
            AddOption(OptionHelper.CreateOption <int>("--wait", defaultValue: 30));
            AddOption(OptionHelper.CreateOption <int>("--serversPerRound", defaultValue: 1));
            AddOption(OptionHelper.CreateOption <int>("--rounds", defaultValue: 5));
            AddOption(OptionHelper.CreateOption <int>("--roundDelay", defaultValue: 60));
            AddOption(OptionHelper.CreateOption <bool>("--graceful", defaultValue: false));
            AddOption(OptionHelper.CreateOption <bool>("--restart", defaultValue: false));

            Handler = CommandHandler.Create <Parameters>(RunAsync);
            _logger = logger;
        }
Пример #3
0
        public ServerCommand(ISiloConfigurator <T> siloConfigurator)
            : base(siloConfigurator.Name)
        {
            _siloRunner = new ServerRunner <T>(siloConfigurator);

            AddOption(OptionHelper.CreateOption <string>("--serviceId", isRequired: true));
            AddOption(OptionHelper.CreateOption <string>("--clusterId", isRequired: true));
            AddOption(OptionHelper.CreateOption("--siloPort", defaultValue: 11111));
            AddOption(OptionHelper.CreateOption("--gatewayPort", defaultValue: 30000));
            AddOption(OptionHelper.CreateOption("--secretSource", defaultValue: SecretConfiguration.SecretSource.File));

            foreach (var opt in siloConfigurator.Options)
            {
                AddOption(opt);
            }

            Handler = CommandHandler.Create <CommonParameters, T>(_siloRunner.Run);
        }
Пример #4
0
        public ScenarioCommand(ILoadGeneratorScenario <T> scenario, ILoggerFactory loggerFactory)
            : base(scenario.Name)
        {
            _runner = new LoadGeneratorScenarioRunner <T>(scenario, loggerFactory);

            // ClientParameters
            AddOption(OptionHelper.CreateOption <string>("--serviceId", isRequired: true));
            AddOption(OptionHelper.CreateOption <string>("--clusterId", isRequired: true));
            AddOption(OptionHelper.CreateOption <int>("--connectionsPerEndpoint", defaultValue: 1, validator: OptionHelper.OnlyStrictlyPositive));
            AddOption(OptionHelper.CreateOption("--secretSource", defaultValue: SecretConfiguration.SecretSource.File));

            // LoadGeneratorParameters
            AddOption(OptionHelper.CreateOption <int>("--numWorkers", defaultValue: 250, validator: OptionHelper.OnlyStrictlyPositive));
            AddOption(OptionHelper.CreateOption <int>("--blocksPerWorker", defaultValue: 10));
            AddOption(OptionHelper.CreateOption <int>("--requestsPerBlock", defaultValue: 500, validator: OptionHelper.OnlyStrictlyPositive));
            AddOption(OptionHelper.CreateOption <int>("--duration", defaultValue: 0, validator: OptionHelper.OnlyPositiveOrZero));

            Handler = CommandHandler.Create <ClientParameters, LoadGeneratorParameters>(_runner.Run);
        }