예제 #1
0
        public void StartPeriodicDataRecording_ShouldStartServices()
        {
            // Act.
            _synchronizer.StartPeriodicDataRecording();

            // Assert.
            _impressionsLog.Verify(mock => mock.Start(), Times.Once);
            _eventsLog.Verify(mock => mock.Start(), Times.Once);
            _metricsLog.Verify(mock => mock.Start(), Times.Once);
        }
예제 #2
0
        public void Start()
        {
            _tasksManager.Start(() =>
            {
                try
                {
                    while (!_synchronizer.SyncAll(_shutdownCancellationTokenSource, asynchronous: false))
                    {
                        _wrapperAdapter.TaskDelay(500).Wait();
                    }

                    _statusManager.SetReady();
                    _telemetrySyncTask.RecordConfigInit();
                    _synchronizer.StartPeriodicDataRecording();

                    if (_streamingEnabled)
                    {
                        _log.Debug("Starting streaming mode...");
                        var connected = _pushManager.StartSse().Result;

                        if (connected)
                        {
                            return;
                        }
                    }

                    _log.Debug("Starting polling mode ...");
                    _synchronizer.StartPeriodicFetching();
                    _telemetryRuntimeProducer.RecordStreamingEvent(new StreamingEvent(EventTypeEnum.SyncMode, (int)SyncModeEnum.Polling));
                }
                catch (Exception ex)
                {
                    _log.Debug("Exception initialization SDK.", ex);
                }
            }, _shutdownCancellationTokenSource, "SDK Initialization");
        }
예제 #3
0
 private void StartPoll()
 {
     _log.Debug("Starting push mode ...");
     _synchronizer.StartPeriodicFetching();
     _synchronizer.StartPeriodicDataRecording();
 }