Esempio n. 1
0
 public Synchronizer(ISplitFetcher splitFetcher,
                     ISelfRefreshingSegmentFetcher segmentFetcher,
                     IImpressionsLog impressionsLog,
                     IEventsLog eventsLog,
                     IImpressionsCountSender impressionsCountSender,
                     IWrapperAdapter wrapperAdapter,
                     IStatusManager statusManager,
                     ITelemetrySyncTask telemetrySyncTask,
                     ITasksManager tasksManager,
                     ISplitCache splitCache,
                     IBackOff backOff,
                     int onDemandFetchMaxRetries,
                     int onDemandFetchRetryDelayMs,
                     ISegmentCache segmentCache,
                     ISplitLogger log = null)
 {
     _splitFetcher              = splitFetcher;
     _segmentFetcher            = segmentFetcher;
     _impressionsLog            = impressionsLog;
     _eventsLog                 = eventsLog;
     _impressionsCountSender    = impressionsCountSender;
     _wrapperAdapter            = wrapperAdapter;
     _statusManager             = statusManager;
     _telemetrySyncTask         = telemetrySyncTask;
     _tasksManager              = tasksManager;
     _splitCache                = splitCache;
     _backOffSplits             = backOff;
     _backOffSegments           = backOff;
     _onDemandFetchMaxRetries   = onDemandFetchMaxRetries;
     _onDemandFetchRetryDelayMs = onDemandFetchRetryDelayMs;
     _segmentCache              = segmentCache;
     _log = log ?? WrapperAdapter.GetLogger(typeof(Synchronizer));
     _defaultFetchOptions = new FetchOptions();
 }
Esempio n. 2
0
        public SyncManager(bool streamingEnabled,
                           ISynchronizer synchronizer,
                           IPushManager pushManager,
                           ISSEHandler sseHandler,
                           INotificationManagerKeeper notificationManagerKeeper,
                           ITelemetryRuntimeProducer telemetryRuntimeProducer,
                           IStatusManager statusManager,
                           ITasksManager tasksManager,
                           IWrapperAdapter wrapperAdapter,
                           ITelemetrySyncTask telemetrySyncTask,
                           ISplitLogger log = null)
        {
            _streamingEnabled = streamingEnabled;
            _synchronizer     = synchronizer;
            _pushManager      = pushManager;
            _sseHandler       = sseHandler;
            _log = log ?? WrapperAdapter.GetLogger(typeof(Synchronizer));
            _telemetryRuntimeProducer = telemetryRuntimeProducer;
            _statusManager            = statusManager;
            _tasksManager             = tasksManager;
            _wrapperAdapter           = wrapperAdapter;
            _telemetrySyncTask        = telemetrySyncTask;

            _sseHandler.ActionEvent += OnProcessFeedbackSSE;
            notificationManagerKeeper.ActionEvent += OnProcessFeedbackSSE;

            _shutdownCancellationTokenSource = new CancellationTokenSource();
        }
Esempio n. 3
0
 public SegmentsWorker(ISynchronizer synchronizer,
                       ITasksManager tasksManager,
                       ISplitLogger log = null)
 {
     _synchronizer = synchronizer;
     _tasksManager = tasksManager;
     _log          = log ?? WrapperAdapter.GetLogger(typeof(SegmentsWorker));
     _queue        = new BlockingCollection <SegmentQueueDto>(new ConcurrentQueue <SegmentQueueDto>());
 }
Esempio n. 4
0
        public ImpressionsManagerTests()
        {
            _impressionsObserver        = new Mock <IImpressionsObserver>();
            _impressionsLog             = new Mock <IImpressionsLog>();
            _customerImpressionListener = new Mock <IImpressionListener>();
            _impressionsCounter         = new Mock <IImpressionsCounter>();
            _telemetryRuntimeProducer   = new Mock <ITelemetryRuntimeProducer>();

            _tasksManager = new TasksManager(new WrapperAdapter());
        }
Esempio n. 5
0
 public SplitsWorker(ISplitCache splitCache,
                     ISynchronizer synchronizer,
                     ITasksManager tasksManager,
                     ISplitLogger log = null)
 {
     _splitCache   = splitCache;
     _synchronizer = synchronizer;
     _tasksManager = tasksManager;
     _log          = log ?? WrapperAdapter.GetLogger(typeof(SplitsWorker));
     _queue        = new BlockingCollection <long>(new ConcurrentQueue <long>());
 }
Esempio n. 6
0
 public ImpressionsCountSender(IImpressionsSdkApiClient apiClient,
                               IImpressionsCounter impressionsCounter,
                               ITasksManager tasksManager,
                               int?interval = null)
 {
     _apiClient               = apiClient;
     _impressionsCounter      = impressionsCounter;
     _cancellationTokenSource = new CancellationTokenSource();
     _interval     = interval ?? CounterRefreshRateSeconds;
     _running      = false;
     _tasksManager = tasksManager;
 }
        public MainWindowVM(ITasksManager tasksManager, IGroupsManager groupsManager,
            IChecklistElementOrganizer ceOrganizer)
        {
            _tasksManager = tasksManager;
            _groupsManager = groupsManager;
            _ceOrganizer = ceOrganizer;

            DateTime today = DateTime.Now;
            _currentDate = new DateTime(today.Year, today.Month, today.Day);

            GetVmTreeForDate(_currentDate);
        }
Esempio n. 8
0
 public ImpressionsLog(IImpressionsSdkApiClient apiClient,
                       int interval,
                       ISimpleCache <KeyImpression> impressionsCache,
                       ITasksManager tasksManager,
                       int maximumNumberOfKeysToCache = -1)
 {
     _apiClient               = apiClient;
     _impressionsCache        = (impressionsCache as ISimpleProducerCache <KeyImpression>) ?? new InMemorySimpleCache <KeyImpression>(new BlockingQueue <KeyImpression>(maximumNumberOfKeysToCache));
     _interval                = interval;
     _cancellationTokenSource = new CancellationTokenSource();
     _tasksManager            = tasksManager;
 }
Esempio n. 9
0
 public SplitClient(ISplitLogger log)
 {
     _log                          = log;
     _keyValidator                 = new KeyValidator();
     _splitNameValidator           = new SplitNameValidator();
     _eventTypeValidator           = new EventTypeValidator();
     _eventPropertiesValidator     = new EventPropertiesValidator();
     _factoryInstantiationsService = FactoryInstantiationsService.Instance();
     _wrapperAdapter               = new WrapperAdapter();
     _configService                = new ConfigService(_wrapperAdapter, _log);
     _tasksManager                 = new TasksManager(_wrapperAdapter);
     _statusManager                = new InMemoryReadinessGatesCache();
 }
Esempio n. 10
0
        public SyncManagerTests()
        {
            _wrapperAdapter = new WrapperAdapter();
            _taskManager    = new TasksManager(_wrapperAdapter);

            _synchronizer = new Mock <ISynchronizer>();
            _pushManager  = new Mock <IPushManager>();
            _sseHandler   = new Mock <ISSEHandler>();
            _log          = new Mock <ISplitLogger>();
            _notificationManagerKeeper = new Mock <INotificationManagerKeeper>();
            _telemetryRuntimeProducer  = new Mock <ITelemetryRuntimeProducer>();
            _telemetrySyncTask         = new Mock <ITelemetrySyncTask>();
            _statusManager             = new Mock <IStatusManager>();
        }
Esempio n. 11
0
 public SelfRefreshingSplitFetcher(ISplitChangeFetcher splitChangeFetcher,
                                   ISplitParser splitParser,
                                   IStatusManager statusManager,
                                   int interval,
                                   ITasksManager taskManager,
                                   ISplitCache splitCache = null)
 {
     _splitChangeFetcher = splitChangeFetcher;
     _splitParser        = splitParser;
     _statusManager      = statusManager;
     _interval           = interval;
     _splitCache         = splitCache;
     _taskManager        = taskManager;
 }
Esempio n. 12
0
 public EventSdkApiClient(string apiKey,
                          Dictionary <string, string> headers,
                          string baseUrl,
                          long connectionTimeOut,
                          long readTimeout,
                          ITelemetryRuntimeProducer telemetryRuntimeProducer,
                          ITasksManager tasksManager,
                          IWrapperAdapter wrapperAdapter,
                          int maxBulkSize) : base(apiKey, headers, baseUrl, connectionTimeOut, readTimeout, telemetryRuntimeProducer)
 {
     _tasksManager   = tasksManager;
     _wrapperAdapter = wrapperAdapter;
     _maxBulkSize    = maxBulkSize;
 }
Esempio n. 13
0
        public EventSourceClient(INotificationParser notificationParser,
                                 IWrapperAdapter wrapperAdapter,
                                 ISplitioHttpClient splitHttpClient,
                                 ITelemetryRuntimeProducer telemetryRuntimeProducer,
                                 ITasksManager tasksManager,
                                 ISplitLogger log = null)
        {
            _notificationParser = notificationParser;
            _wrapperAdapter     = wrapperAdapter;
            _splitHttpClient    = splitHttpClient;
            _log = log ?? WrapperAdapter.GetLogger(typeof(EventSourceClient));
            _telemetryRuntimeProducer = telemetryRuntimeProducer;
            _tasksManager             = tasksManager;

            _firstEvent = true;
        }
Esempio n. 14
0
 public SelfRefreshingSegmentFetcher(ISegmentChangeFetcher segmentChangeFetcher,
                                     IStatusManager statusManager,
                                     int interval,
                                     ISegmentCache segmentsCache,
                                     int numberOfParallelSegments,
                                     ISegmentTaskQueue segmentTaskQueue,
                                     ITasksManager tasksManager,
                                     IWrapperAdapter wrapperAdapter) : base(segmentsCache)
 {
     _segmentChangeFetcher = segmentChangeFetcher;
     _segments             = new ConcurrentDictionary <string, SelfRefreshingSegment>();
     _worker           = new SegmentTaskWorker(numberOfParallelSegments, segmentTaskQueue);
     _interval         = interval;
     _statusManager    = statusManager;
     _wrappedAdapter   = wrapperAdapter;
     _segmentTaskQueue = segmentTaskQueue;
     _tasksManager     = tasksManager;
 }
Esempio n. 15
0
 public ImpressionsManager(IImpressionsLog impressionsLog,
                           IImpressionListener customerImpressionListener,
                           IImpressionsCounter impressionsCounter,
                           bool addPreviousTime,
                           ImpressionsMode impressionsMode,
                           ITelemetryRuntimeProducer telemetryRuntimeProducer,
                           ITasksManager taskManager,
                           IImpressionsObserver impressionsObserver = null)
 {
     _impressionsLog             = impressionsLog;
     _customerImpressionListener = customerImpressionListener;
     _impressionsCounter         = impressionsCounter;
     _addPreviousTime            = addPreviousTime;
     _optimized                = impressionsMode == ImpressionsMode.Optimized && addPreviousTime;
     _impressionsObserver      = impressionsObserver;
     _telemetryRuntimeProducer = telemetryRuntimeProducer;
     _taskManager              = taskManager;
 }
Esempio n. 16
0
        public EventsLog(IEventSdkApiClient apiClient,
                         int firstPushWindow,
                         int interval,
                         ISimpleCache <WrappedEvent> eventsCache,
                         ITelemetryRuntimeProducer telemetryRuntimeProducer,
                         ITasksManager tasksManager,
                         int maximumNumberOfKeysToCache = -1)
        {
            _cancellationTokenSource = new CancellationTokenSource();

            _wrappedEventsCache       = (eventsCache as ISimpleProducerCache <WrappedEvent>) ?? new InMemorySimpleCache <WrappedEvent>(new BlockingQueue <WrappedEvent>(maximumNumberOfKeysToCache));
            _apiClient                = apiClient;
            _interval                 = interval;
            _firstPushWindow          = firstPushWindow;
            _telemetryRuntimeProducer = telemetryRuntimeProducer;
            _tasksManager             = tasksManager;

            _wrapperAdapter = new WrapperAdapter();
        }
Esempio n. 17
0
        public TelemetrySyncTask(ITelemetryStorageConsumer telemetryStorage,
                                 ITelemetryAPI telemetryAPI,
                                 ISplitCache splitCache,
                                 ISegmentCache segmentCache,
                                 SelfRefreshingConfig configurationOptions,
                                 IFactoryInstantiationsService factoryInstantiationsService,
                                 IWrapperAdapter wrapperAdapter,
                                 ITasksManager tasksManager,
                                 ISplitLogger log = null)
        {
            _telemetryStorageConsumer = telemetryStorage;
            _telemetryAPI             = telemetryAPI;
            _splitCache                   = splitCache;
            _segmentCache                 = segmentCache;
            _configurationOptions         = configurationOptions;
            _factoryInstantiationsService = factoryInstantiationsService;
            _log            = log ?? WrapperAdapter.GetLogger(typeof(TelemetrySyncTask));
            _wrapperAdapter = wrapperAdapter;
            _tasksManager   = tasksManager;

            _cancellationTokenSource = new CancellationTokenSource();
        }
Esempio n. 18
0
 public TasksController(ITasksManager tasksManager, IReadOnlyPanelManager panelManager, IMapper mapper)
 {
     this.tasksManager = tasksManager;
     this.panelManager = panelManager;
     this.mapper       = mapper;
 }
Esempio n. 19
0
 public EventsLogTests()
 {
     _telemetryRuntimeProducer = new Mock <ITelemetryRuntimeProducer>();
     _wrapperAdapter           = new WrapperAdapter();
     _tasksManger = new TasksManager(_wrapperAdapter);
 }
 public TaskController(ITasksManager tasksManager)
 {
     _tasksManager = tasksManager;
 }