Exemplo n.º 1
0
        public async Task Start(string configurationContent, IList <IRpcClient> clients)
        {
            var benchConfig = new BenchmarkConfiguration(configurationContent);

            if (benchConfig.Debug)
            {
                DumpConfiguration(configurationContent);
            }
            if (benchConfig.Pipeline.Count == 0)
            {
                if (BenchmarkConfiguration.IsResultParser(configurationContent))
                {
                    BenchmarkConfiguration.ParseResult(configurationContent);
                }
                return;
            }
            var stepHandler = new StepHandler(this);

            foreach (var client in clients)
            {
                client.InstallSerializerAndDeserializer(Serialize, Deserialize);
            }
            var clsName = $"{GetType().FullName}, {GetType().Namespace}";

            await InstallPluginInSlaves(clients, clsName);

            // Process pipeline
            try
            {
                foreach (var parallelStep in benchConfig.Pipeline)
                {
                    var tasks = new List <Task>();
                    foreach (var step in parallelStep)
                    {
                        tasks.Add(stepHandler.HandleStep(step, clients, benchConfig.Debug));
                    }
                    await Task.WhenAll(tasks);
                }
            }
            catch (Exception e)
            {
                Log.Error($"Stop for {e.Message}");
            }
        }
Exemplo n.º 2
0
 public bool NeedSlaves(string configuration)
 {
     // Simple configuration to parse result (counters.txt) does not need slave agents
     return(!BenchmarkConfiguration.IsConfigInSimpleMode(configuration) ||
            !BenchmarkConfiguration.IsResultParser(configuration));
 }