コード例 #1
0
        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;
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        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;
        }
コード例 #5
0
        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;
        }
コード例 #6
0
        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();
        }
コード例 #7
0
 public RabbitMqMessageLatencyTransport(RabbitMqHostSettings hostSettings, IMessageLatencySettings settings)
 {
     _hostSettings = hostSettings;
     _settings     = settings;
 }
 public RabbitMqMessageLatencyTransport(RabbitMqHostSettings hostSettings, IMessageLatencySettings settings)
 {
     _hostSettings = hostSettings;
     _settings = settings;
 }
 public ServiceBusMessageLatencyTransport(ServiceBusHostSettings hostSettings, IMessageLatencySettings settings)
 {
     _hostSettings = hostSettings;
     _settings = settings;
 }
コード例 #10
0
 public AmazonSqsMessageLatencyTransport(AmazonSqsHostSettings hostSettings, IMessageLatencySettings settings)
 {
     _hostSettings = hostSettings;
     _settings     = settings;
 }
コード例 #11
0
 public ActiveMqMessageLatencyTransport(ActiveMqHostSettings hostSettings, IMessageLatencySettings settings)
 {
     _hostSettings = hostSettings;
     _settings     = settings;
 }
コード例 #12
0
 public MediatorMessageLatencyTransport(IMessageLatencySettings settings)
 {
     _settings = settings;
 }
コード例 #13
0
 public GrpcMessageLatencyTransport(GrpcOptionSet options, IMessageLatencySettings settings)
 {
     _options  = options;
     _settings = settings;
 }
 public ServiceBusMessageLatencyTransport(ServiceBusHostSettings hostSettings, IMessageLatencySettings settings)
 {
     _hostSettings = hostSettings;
     _settings     = settings;
 }
 public InMemoryMessageLatencyTransport(InMemoryOptionSet optionSet, IMessageLatencySettings settings)
 {
     _optionSet = optionSet;
     _settings  = settings;
 }