Beispiel #1
0
        public AutomationToolBase(ArgsOption argOption)
        {
            // Initialize
            _appserverProject                 = argOption.AppserverProject;
            _appserverLogDirPath              = argOption.AppserverLogDirectory;
            _notStartAppServer                = argOption.NotStartAppServer == 1;
            _notStopAppServer                 = argOption.NotStopAppServer == 1;
            _masterProject                    = argOption.MasterProject;
            _agentProject                     = argOption.AgentProject;
            _appserverTargetPath              = argOption.AppserverTargetPath;
            _masterTargetPath                 = argOption.MasterTargetPath;
            _agentTargetPath                  = argOption.AgentTargetPath;
            _benchmarkConfiguration           = new FileInfo(argOption.BenchmarkConfiguration);
            _benchmarkConfigurationTargetPath = argOption.BenchmarkConfigurationTargetPath;
            _agentList     = argOption.AgentList;
            _rpcPort       = argOption.RpcPort;
            _appserverPort = argOption.AppserverPort;
            _azureSignalRConnectionString = argOption.AzureSignalRConnectionString;
            _username = argOption.Username;
            _password = argOption.Password;
            var appServerCount      = argOption.AppServerHostnames.Count();
            var appServerCountInUse = argOption.AppServerCountInUse;

            _appServerHostNameList = argOption.AppServerHostnames?.Take(
                appServerCountInUse < appServerCount ?
                appServerCountInUse : appServerCount).ToList();
            // Create clients
            _masterHostName    = argOption.MasterHostname;
            _agentHostNameList = (from agent in argOption.AgentList select agent.Split(':')[0]).ToList();

            _remoteClients = new RemoteClients();
            _remoteClients.CreateAll(_username, _password,
                                     _appServerHostNameList, _masterHostName, _agentHostNameList);
        }
Beispiel #2
0
        private static ArgsOption ParseArgs(string[] args)
        {
            Log.Information($"Parse arguments...");
            var argsOption = new ArgsOption();
            var result     = Parser.Default.ParseArguments <ArgsOption>(args)
                             .WithParsed(options => argsOption = options)
                             .WithNotParsed(error =>
            {
                Log.Error($"Error in parsing arguments: {error}");
                throw new ArgumentException($"Error in parsing arguments: {error}");
            });

            return(argsOption);
        }
Beispiel #3
0
 public AutomationTool(ArgsOption argOption) : base(argOption)
 {
 }