protected async Task GenerateLoad(int requests) { var srcNumberOfItems = SourceItems.Count(); List <string> selectedItems; var randomResources = SourceItems.OrderBy(i => Guid.NewGuid()); if (requests <= srcNumberOfItems) { selectedItems = randomResources.Take(requests).ToList(); } else { var tmpList = new List <string>(); do { tmpList.AddRange(randomResources.Take(requests)); requests -= srcNumberOfItems; } while (requests >= 0); selectedItems = tmpList; } _executionsPerSecond = selectedItems.Count; Console.WriteLine(PrintTestProgress()); Interlocked.Add(ref ExpectedExecutionCount, selectedItems.Count()); await Load(selectedItems); }