Exemplo n.º 1
0
        public BenchmarkSchedulerService(MessageMetricCapture capture, MessageLatencySettings settings, IMessageScheduler scheduler,
                                         IEndpointNameFormatter endpointNameFormatter, IHostApplicationLifetime lifetime)
        {
            _capture   = capture;
            _settings  = settings;
            _scheduler = scheduler;
            _lifetime  = lifetime;

            _address = new Uri($"exchange:{endpointNameFormatter.Consumer<MessageLatencyConsumer>()}");
        }
        public MessageMetricCapture(MessageLatencySettings settings)
        {
            _messageCount = settings.MessageCount;

            _consumedMessages = new ConcurrentDictionary <Guid, ConsumedMessage>();
            _sentMessages     = new ConcurrentDictionary <Guid, SentMessage>();
            _sendCompleted    = new TaskCompletionSource <TimeSpan>();
            _consumeCompleted = new TaskCompletionSource <TimeSpan>();

            _stopwatch = Stopwatch.StartNew();
        }