Пример #1
0
 public RtqTaskCounterEventConsumer(RtqTaskCounterStateManager stateManager,
                                    IHandleTasksMetaStorage handleTasksMetaStorage,
                                    RtqMonitoringPerfGraphiteReporter perfGraphiteReporter)
 {
     this.stateManager           = stateManager;
     this.handleTasksMetaStorage = handleTasksMetaStorage;
     this.perfGraphiteReporter   = perfGraphiteReporter;
 }
Пример #2
0
        public RtqMonitoringEventBulkIndexer(ILog logger,
                                             RtqElasticsearchIndexerSettings indexerSettings,
                                             IRtqElasticsearchClient elasticsearchClient,
                                             RemoteTaskQueue remoteTaskQueue,
                                             IStatsDClient statsDClient)
        {
            this.indexerSettings = indexerSettings;
            eventSource          = new RtqEventSource(remoteTaskQueue.EventLogRepository);
            offsetInterpreter    = new RtqEventLogOffsetInterpreter();
            var perfGraphiteReporter = new RtqMonitoringPerfGraphiteReporter(statsDClient,
                                                                             graphitePathPrefix: $"{indexerSettings.RtqGraphitePathPrefix}.ElasticsearchBulkIndexer.Perf");

            this.logger       = logger.ForContext("CassandraDistributedTaskQueue").ForContext(nameof(RtqMonitoringEventBulkIndexer));
            taskMetaProcessor = new TaskMetaProcessor(this.logger, indexerSettings, elasticsearchClient, remoteTaskQueue, perfGraphiteReporter);
        }
Пример #3
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 RtqMonitoringEventFeeder(ILog logger,
                                        RtqElasticsearchIndexerSettings indexerSettings,
                                        IRtqElasticsearchClient elasticsearchClient,
                                        IGraphiteClient graphiteClient,
                                        IStatsDClient statsDClient,
                                        IRtqPeriodicJobRunner rtqPeriodicJobRunner,
                                        RemoteTaskQueue remoteTaskQueue)
        {
            this.logger              = logger.ForContext("CassandraDistributedTaskQueue").ForContext(nameof(RtqMonitoringEventFeeder));
            this.indexerSettings     = indexerSettings;
            this.elasticsearchClient = elasticsearchClient;
            GlobalTime  = remoteTaskQueue.GlobalTime;
            eventSource = new RtqEventSource(remoteTaskQueue.EventLogRepository);
            var eventFeedPeriodicJobRunner = new RtqEventFeedPeriodicJobRunner(rtqPeriodicJobRunner, graphiteClient, indexerSettings.EventFeedGraphitePathPrefix);

            eventFeedFactory = new EventFeedFactory(new RtqEventFeedGlobalTimeProvider(GlobalTime), eventFeedPeriodicJobRunner);
            var perfGraphiteReporter = new RtqMonitoringPerfGraphiteReporter(statsDClient, indexerSettings.PerfGraphitePathPrefix);
            var taskMetaProcessor    = new TaskMetaProcessor(this.logger, indexerSettings, elasticsearchClient, remoteTaskQueue, perfGraphiteReporter);

            eventConsumer = new RtqMonitoringEventConsumer(indexerSettings, taskMetaProcessor);
        }
Пример #5
0
 public TaskMetaProcessor(ILog logger,
                          RtqElasticsearchIndexerSettings settings,
                          IRtqElasticsearchClient elasticClient,
                          RemoteTaskQueue remoteTaskQueue,
                          RtqMonitoringPerfGraphiteReporter perfGraphiteReporter)
 {
     this.logger              = logger.ForContext(nameof(TaskMetaProcessor));
     this.settings            = settings;
     handleTasksMetaStorage   = remoteTaskQueue.HandleTasksMetaStorage;
     taskDataRegistry         = remoteTaskQueue.TaskDataRegistry;
     taskDataStorage          = remoteTaskQueue.TaskDataStorage;
     taskExceptionInfoStorage = remoteTaskQueue.TaskExceptionInfoStorage;
     serializer = remoteTaskQueue.Serializer;
     this.perfGraphiteReporter = perfGraphiteReporter;
     this.elasticClient        = elasticClient;
     bulkRequestTimeout        = new BulkRequestParameters
     {
         Timeout = this.settings.BulkIndexRequestTimeout,
         RequestConfiguration = new RequestConfiguration {
             RequestTimeout = this.settings.BulkIndexRequestTimeout
         }
     };
 }
        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() });
        }