private static void Main(string[] args) { var amqpQueueMetricsManager = new RabbitMQQueueMetricsManager(false, "localhost", 15672, "paul", "password"); AMQPQueueMetricsAnalyser amqpQueueMetricsAnalyser = new RabbitMQQueueMetricsAnalyser( new ConsumerUtilisationTooLowAMQPQueueMetricAnalyser( new ConsumptionRateIncreasedAMQPQueueMetricAnalyser( new DispatchRateDecreasedAMQPQueueMetricAnalyser( new QueueLengthIncreasedAMQPQueueMetricAnalyser( new ConsumptionRateDecreasedAMQPQueueMetricAnalyser( new StableAMQPQueueMetricAnalyser()))))), 20); AMQPConsumerNotifier amqpConsumerNotifier = new RabbitMQConsumerNotifier(RabbitMQAdapter.Instance, "monitor"); RabbitMQAdapter.Instance.Init("localhost", 5672, "paul", "password", 50); var queueWatch = new QueueWatch(amqpQueueMetricsManager, amqpQueueMetricsAnalyser, amqpConsumerNotifier, 5000); queueWatch.AMQPQueueMetricsAnalysed += QueueWatchOnAMQPQueueMetricsAnalysed; queueWatch.StartAsync(); Console.ReadLine(); }
public void Init() { var amqpQueueMetricsManager = new RabbitMQQueueMetricsManager(false, "localhost", 15672, "paul", "password"); AMQPQueueMetricsAnalyser amqpQueueMetricsAnalyser = new RabbitMQQueueMetricsAnalyser( new ConsumerUtilisationTooLowAMQPQueueMetricAnalyser( new ConsumptionRateIncreasedAMQPQueueMetricAnalyser( new DispatchRateDecreasedAMQPQueueMetricAnalyser( new QueueLengthIncreasedAMQPQueueMetricAnalyser( new ConsumptionRateDecreasedAMQPQueueMetricAnalyser( new StableAMQPQueueMetricAnalyser()))))), 20); AMQPConsumerNotifier amqpConsumerNotifier = new RabbitMQConsumerNotifier(RabbitMQAdapter.Instance, "monitor"); RabbitMQAdapter.Instance.Init("localhost", 5672, "paul", "password", 50); _queueWatch = new QueueWatch(amqpQueueMetricsManager, amqpQueueMetricsAnalyser, amqpConsumerNotifier, 5000); _queueWatch.AMQPQueueMetricsAnalysed += QueueWatchOnAMQPQueueMetricsAnalysed; _queueWatch.StartAsync(); }