Example #1
0
        public RemoteNetworkEventQueue(IOptions <QueueSettings> options, IInternalMqttClient client)
        {
            this.m_networkEventQueueTopic = options.Value.NetworkEventQueueTopic;

            this.m_client = client;
            this.m_events = new Deque <NetworkEvent>();
            this.m_gauge  = Metrics.CreateGauge("router_events_queued", "Number of messages in the events queue.");
        }
Example #2
0
        public RemoteStorageQueue(IOptions <QueueSettings> options, IInternalMqttClient client)
        {
            this.m_measurementStorageQueue = options.Value.MeasurementStorageQueueTopic;
            this.m_messageStorageQueue     = options.Value.MessageStorageQueueTopic;

            this.m_client       = client;
            this.m_messages     = new Deque <Message>();
            this.m_measurements = new Deque <Measurement>();
            this.m_gauge        = Metrics.CreateGauge("router_storage_messages_queued", "Number of messages in the storage queue.");
        }
        public RemoteTriggerQueue(IOptions <QueueSettings> options, IInternalMqttClient client)
        {
            this.m_gaugeTriggerSerivce = Metrics.CreateGauge("router_trigger_messages_queued", "Number of messages in the trigger queue.");

            this.m_triggerMeasurements = new MeasurementData();
            this.m_triggerMessages     = new TextMessageData();
            this.m_measurementLock     = new SpinLockWrapper();
            this.m_messageLock         = new SpinLockWrapper();

            this.m_client = client;
            this.m_messageTriggerTopic     = options.Value.TriggerQueueTemplate.Replace("$type", "messages");
            this.m_measurementTriggerTopic = options.Value.TriggerQueueTemplate.Replace("$type", "measurements");
        }
Example #4
0
 public HealthMonitoringService(IQueue <IPlatformMessage> inputQueue,
                                IRemoteTriggerQueue triggerQueue,
                                IRemoteLiveDataQueue @internal,
                                IPublicRemoteQueue @public,
                                IPublicMqttClient publicClient,
                                IInternalMqttClient internalClient,
                                IOptions <HealthCheckSettings> settings)
 {
     this.m_liveDataQueues     = @internal;
     this.m_publicQueue        = @public;
     this.m_inputQueue         = inputQueue;
     this.m_internalMqttClient = internalClient;
     this.m_publicMqttClient   = publicClient;
     this.m_triggerQueue       = triggerQueue;
     this.m_settings           = settings.Value;
 }
        public MqttBulkNumberTriggerHandler(IServiceProvider provider,
                                            IDataPointMatchingService matcher,
                                            IInternalMqttClient client,
                                            IOptions <MqttConfig> options,
                                            ILogger <MqttBulkNumberTriggerHandler> logger)
        {
            this.m_provider   = provider;
            this.logger       = logger;
            this.m_matcher    = matcher;
            this.m_client     = client;
            this.m_eventTopic = options.Value.InternalBroker.TriggerEventTopic;

            this.m_matchCounter       = Metrics.CreateCounter("triggerservice_measurements_matched_total", "Total amount of measurements that matched a trigger.");
            this.m_measurementCounter = Metrics.CreateCounter("triggerservice_measurements_received_total", "Total amount of measurements received.");
            this.m_duration           = Metrics.CreateHistogram("triggerservice_measurement_handle_duration_seconds", "Histogram of measurement handling duration.");
        }
        public RemoteLiveDataQueue(IOptions <QueueSettings> options, IInternalMqttClient client)
        {
            this.m_liveDataLock         = new SpinLockWrapper();
            this.m_liveDataHandlers     = new HashSet <string>();
            this.m_textMessageQueues    = new Dictionary <string, TextMessageData>();
            this.m_measurementQueues    = new Dictionary <string, MeasurementData>();
            this.m_controlMessageQueues = new Dictionary <string, ControlMessageData>();

            this.m_controlMessageLiveDataTopic = options.Value.LiveDataQueueTemplate.Replace("$type", "control");
            this.m_messageLiveDataTopic        = options.Value.LiveDataQueueTemplate.Replace("$type", "messages");
            this.m_measurementLiveDataTopic    = options.Value.LiveDataQueueTemplate.Replace("$type", "measurements");

            this.m_controlLock          = new SpinLockWrapper();
            this.m_measurementLock      = new SpinLockWrapper();
            this.m_messageLock          = new SpinLockWrapper();
            this.m_client               = client;
            this.m_gaugeLiveDataService = Metrics.CreateGauge("router_livedata_messages_queued", "Number of messages in the live data queue.");
        }
 public MqttRegexTriggerHandler(
     ILogger <MqttRegexTriggerHandler> logger,
     IRegexMatchingService matcher,
     IServiceProvider provider,
     IInternalMqttClient client,
     IOptions <MqttConfig> options,
     ITriggerActionCache cache
     )
 {
     this.m_logger         = logger;
     this.m_regexMatcher   = matcher;
     this.m_client         = client;
     this.m_eventsTopic    = options.Value.InternalBroker.TriggerEventTopic;
     this.m_cache          = cache;
     this.m_provider       = provider;
     this.m_matchCounter   = Metrics.CreateCounter("triggerservice_messages_matched_total", "Total amount of measurements that matched a trigger.");
     this.m_messageCounter = Metrics.CreateCounter("triggerservice_messages_received_total", "Total amount of messages received.");
     this.m_duration       = Metrics.CreateHistogram("triggerservice_message_handle_duration_seconds", "Histogram of message handling duration.");
 }
Example #8
0
 public CommandPublisher(IOptions <InternalBrokerConfig> options, IInternalMqttClient mqtt)
 {
     this.m_mqtt  = mqtt;
     this.m_topic = options.Value.CommandTopic;
 }