Exemplo n.º 1
0
 public StatisticsTracker(ThreadPoolTrackingStatistic statistic, TimeSpan delayWarningThreshold, ILogger log, SchedulerStatisticsGroup schedulerStatistics)
 {
     this.statistic             = statistic;
     this.delayWarningThreshold = delayWarningThreshold;
     this.log = log;
     this.schedulerStatistics = schedulerStatistics;
 }
Exemplo n.º 2
0
        public ThreadPoolExecutor(
            ThreadPoolExecutorOptions options,
            SchedulerStatisticsGroup schedulerStatistics,
            StageAnalysisStatisticsGroup schedulerStageStatistics,
            IOptions <StatisticsOptions> statisticsOptions)
        {
            this.options                  = options ?? throw new ArgumentNullException(nameof(options));
            this.schedulerStatistics      = schedulerStatistics;
            this.schedulerStageStatistics = schedulerStageStatistics;
            this.statisticsOptions        = statisticsOptions;

            workQueue = new ThreadPoolWorkQueue();

            statistic = new ThreadPoolTrackingStatistic(options.Name, options.LoggerFactory, statisticsOptions, schedulerStageStatistics);

            executingWorkTracker = new ExecutingWorkItemsTracker(this);

            log = options.LoggerFactory.CreateLogger <ThreadPoolExecutor>();

            options.CancellationTokenSource.Token.Register(Complete);

            for (var threadIndex = 0; threadIndex < options.DegreeOfParallelism; threadIndex++)
            {
                RunWorker(threadIndex);
            }
        }
Exemplo n.º 3
0
 public StatisticsTracker(ThreadPoolTrackingStatistic statistic, TimeSpan delayWarningThreshold, ILogger log)
 {
     this.statistic             = statistic;
     this.delayWarningThreshold = delayWarningThreshold;
     this.log = log;
 }