public ServiceBusMessageLatencyTransport(ServiceBusOptionSet hostSettings, IMessageLatencySettings settings) { _hostSettings = hostSettings; _settings = settings; _split = hostSettings.Split; }
public RabbitMqMessageLatencyTransport(RabbitMqOptionSet hostSettings, IMessageLatencySettings settings) { _hostSettings = hostSettings; _settings = settings; _split = hostSettings.Split; }
static async Task RunLatencyBenchmark(ProgramOptionSet optionSet) { var messageLatencyOptionSet = new MessageLatencyOptionSet(); messageLatencyOptionSet.Parse(_remaining); IMessageLatencySettings settings = messageLatencyOptionSet; IMessageLatencyTransport transport; if (optionSet.Transport == ProgramOptionSet.TransportOptions.AzureServiceBus) { var serviceBusOptionSet = new ServiceBusOptionSet(); serviceBusOptionSet.Parse(_remaining); serviceBusOptionSet.ShowOptions(); ServicePointManager.Expect100Continue = false; ServicePointManager.UseNagleAlgorithm = false; transport = new ServiceBusMessageLatencyTransport(serviceBusOptionSet, settings); } else if (optionSet.Transport == ProgramOptionSet.TransportOptions.RabbitMq) { var rabbitMqOptionSet = new RabbitMqOptionSet(); rabbitMqOptionSet.Parse(_remaining); rabbitMqOptionSet.ShowOptions(); transport = new RabbitMqMessageLatencyTransport(rabbitMqOptionSet, settings); } else if (optionSet.Transport == ProgramOptionSet.TransportOptions.AmazonSqs) { var amazonSqsOptionSet = new AmazonSqsOptionSet(); amazonSqsOptionSet.Parse(_remaining); amazonSqsOptionSet.ShowOptions(); transport = new AmazonSqsMessageLatencyTransport(amazonSqsOptionSet, settings); } else if (optionSet.Transport == ProgramOptionSet.TransportOptions.ActiveMq) { var activeMqOptionSet = new ActiveMqOptionSet(); activeMqOptionSet.Parse(_remaining); activeMqOptionSet.ShowOptions(); transport = new ActiveMqMessageLatencyTransport(activeMqOptionSet, settings); } else { transport = new MediatorMessageLatencyTransport(settings); } var benchmark = new MessageLatencyBenchmark(transport, settings); await benchmark.Run(); }
public MessageLatencyBenchmark(IMessageLatencyTransport transport, IMessageLatencySettings settings) { _transport = transport; _settings = settings; if (settings.MessageCount / settings.Clients * settings.Clients != settings.MessageCount) { throw new ArgumentException("The clients must be a factor of message count"); } _payload = _settings.PayloadSize > 0 ? new string('*', _settings.PayloadSize) : null; }
static void RunLatencyBenchmark(ProgramOptionSet optionSet) { var messageLatencyOptionSet = new MessageLatencyOptionSet(); messageLatencyOptionSet.Parse(_remaining); IMessageLatencySettings settings = messageLatencyOptionSet; IMessageLatencyTransport transport; if (optionSet.Transport == ProgramOptionSet.TransportOptions.AzureServiceBus) { var serviceBusOptionSet = new ServiceBusOptionSet(); serviceBusOptionSet.Parse(_remaining); serviceBusOptionSet.ShowOptions(); ServicePointManager.Expect100Continue = false; ServicePointManager.UseNagleAlgorithm = false; transport = new ServiceBusMessageLatencyTransport(serviceBusOptionSet, settings); } else { var rabbitMqOptionSet = new RabbitMqOptionSet(); rabbitMqOptionSet.Parse(_remaining); rabbitMqOptionSet.ShowOptions(); transport = new RabbitMqMessageLatencyTransport(rabbitMqOptionSet, settings); } var benchmark = new MessageLatencyBenchmark(transport, settings); benchmark.Run(); }
public RabbitMqMessageLatencyTransport(RabbitMqHostSettings hostSettings, IMessageLatencySettings settings) { _hostSettings = hostSettings; _settings = settings; }
public ServiceBusMessageLatencyTransport(ServiceBusHostSettings hostSettings, IMessageLatencySettings settings) { _hostSettings = hostSettings; _settings = settings; }
public AmazonSqsMessageLatencyTransport(AmazonSqsHostSettings hostSettings, IMessageLatencySettings settings) { _hostSettings = hostSettings; _settings = settings; }
public ActiveMqMessageLatencyTransport(ActiveMqHostSettings hostSettings, IMessageLatencySettings settings) { _hostSettings = hostSettings; _settings = settings; }
public MediatorMessageLatencyTransport(IMessageLatencySettings settings) { _settings = settings; }
public GrpcMessageLatencyTransport(GrpcOptionSet options, IMessageLatencySettings settings) { _options = options; _settings = settings; }
public InMemoryMessageLatencyTransport(InMemoryOptionSet optionSet, IMessageLatencySettings settings) { _optionSet = optionSet; _settings = settings; }