예제 #1
0
        private static async Task RunRequestTreeAgent(HttpRequestTree requestTree, int Concurrency, ResultComparerFactory comparerFactory, string requestSource, string outputFilePath)
        {
            // Draw run header
            Console.WriteLine(CliResultViews.StartRequestString, requestSource, Concurrency);

            var requestResult = await RunRequestComparisonAsync(Concurrency, requestTree, comparerFactory);

            var grades = requestResult.Grades;
            var stats  = requestResult.Stats;

            // Draw Stats
            CliResultViews.DrawGrades(grades);
            CliResultViews.DrawStatusCodes(stats);
            CliResultViews.DrawStats(stats);

            var time   = DateTime.UtcNow.ToString("yyyyMMddTHHmmss");
            var result = new HttpRequestTree()
            {
                Requests    = requestResult.Grades.Requests,
                Description = $"{requestTree.Description} : {time}"
            };

            string outputFile = !string.IsNullOrWhiteSpace(outputFilePath)
                ? outputFilePath
                : $"output-{time}.json";

            // Draw output file path
            Console.WriteLine("Result path: {0}", outputFile);

            await new SaveHttpRequestTreeToJson().Execute(result, outputFile);
        }
예제 #2
0
        public void List(ListArgs args)
        {
            var loader = new RequestGeneratorPluginLoader(PluginDir());

            foreach (var generator in loader.Load())
            {
                CliResultViews.DrawGenerator(generator);
            }
        }
예제 #3
0
        public async Task Simple(SimpleArgs args)
        {
            Console.WriteLine(CliResultViews.StartSimpleWithDurationString, args.Duration.TotalSeconds, args.Url, args.Concurrency);

            var requestResult = await RunSimpleLoadTestAsync(args.Url, args.Concurrency, args.Duration, args.Count);

            CliResultViews.DrawStatusCodes(requestResult.Stats);
            CliResultViews.DrawStats(requestResult.Stats);
        }