Beispiel #1
0
 public RtqTaskCounterStateManager(ILog logger,
                                   ISerializer serializer,
                                   IRtqTaskDataRegistry taskDataRegistry,
                                   IRtqTaskCounterStateStorage stateStorage,
                                   RtqTaskCounterSettings settings,
                                   RtqEventLogOffsetInterpreter offsetInterpreter,
                                   RtqMonitoringPerfGraphiteReporter perfGraphiteReporter)
 {
     this.logger               = logger;
     this.serializer           = serializer;
     this.taskDataRegistry     = taskDataRegistry;
     this.stateStorage         = stateStorage;
     this.settings             = settings;
     this.offsetInterpreter    = offsetInterpreter;
     this.perfGraphiteReporter = perfGraphiteReporter;
     CompositeFeedKey          = settings.EventFeedKey;
     Blades = settings.BladeDelays.Select((delay, index) => new BladeId($"{settings.EventFeedKey}_Blade{index}", delay)).ToArray();
 }
        public RtqTaskCounterEventFeeder(ILog logger,
                                         ISerializer serializer,
                                         RtqTaskCounterSettings settings,
                                         IRtqTaskDataRegistry taskDataRegistry,
                                         IRtqTaskCounterStateStorage stateStorage,
                                         IGraphiteClient graphiteClient,
                                         IStatsDClient statsDClient,
                                         IRtqPeriodicJobRunner rtqPeriodicJobRunner,
                                         RemoteTaskQueue remoteTaskQueue)
        {
            this.serializer       = serializer;
            this.settings         = settings;
            this.taskDataRegistry = taskDataRegistry;
            this.stateStorage     = stateStorage;
            GlobalTime            = remoteTaskQueue.GlobalTime;
            var eventFeedPeriodicJobRunner = new RtqEventFeedPeriodicJobRunner(rtqPeriodicJobRunner, graphiteClient, settings.EventFeedGraphitePathPrefix);

            eventFeedFactory       = new EventFeedFactory(new RtqEventFeedGlobalTimeProvider(GlobalTime), eventFeedPeriodicJobRunner);
            eventSource            = new RtqEventSource(remoteTaskQueue.EventLogRepository);
            handleTasksMetaStorage = remoteTaskQueue.HandleTasksMetaStorage;
            perfGraphiteReporter   = new RtqMonitoringPerfGraphiteReporter(statsDClient, settings.PerfGraphitePathPrefix);
            this.logger            = logger.ForContext("CassandraDistributedTaskQueue").ForContext(nameof(RtqTaskCounterEventFeeder));
            this.logger.Info("Using RtqTaskCounterSettings: {RtqTaskCounterSettings}", new { RtqTaskCounterSettings = settings.ToPrettyJson() });
        }