Beispiel #1
0
 public async Task Rest3GetMediumPayloadAsync()
 {
     for (int i = 0; i < 100; i++)
     {
         await _rest3Service.GetRangeAsync(1000);
     }
 }
        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            _logger.LogInformation($"Simulating load with concurrency: {_concurrency}");
            while (!stoppingToken.IsCancellationRequested)
            {
                var tasks = new List <Task>();

                for (int i = 0; i < _concurrency; i++)
                {
                    tasks.Add(_grpcService.GetRangeAsync(100));
                    tasks.Add(_restService.GetRangeAsync(100));
                }

                await Task.WhenAll(tasks);
            }
        }