public async Task NizzleName(int messageCount, bool useNewIndexScript, bool dropOldIndex) { if (useNewIndexScript) { SqlTestHelper.Execute(IndexCreationScriptToCheck); SqlTestHelper.DropIndex(TableName, $"IDX_RECEIVE_{TableName}"); } Console.WriteLine($"Sending {messageCount} messages..."); await Task.WhenAll(Enumerable.Range(0, messageCount) .Select(i => _adapter.Bus.SendLocal($"THIS IS MESSAGE {i}"))); var counter = new SharedCounter(messageCount); _adapter.Handle <string>(async message => counter.Decrement()); Console.WriteLine("Waiting for messages to be received..."); var stopwtach = Stopwatch.StartNew(); _adapter.Bus.Advanced.Workers.SetNumberOfWorkers(3); counter.WaitForResetEvent(messageCount / 500 + 5); var elapsedSeconds = stopwtach.Elapsed.TotalSeconds; Console.WriteLine($"{messageCount} messages received in {elapsedSeconds:0.0} s - that's {messageCount / elapsedSeconds:0.0} msg/s"); }