Ejemplo n.º 1
0
 public SiloStatisticsManager(
     IOptions <SiloStatisticsOptions> statisticsOptions,
     IOptions <LoadSheddingOptions> loadSheddingOptions,
     IOptions <StorageOptions> azureStorageOptions,
     ILocalSiloDetails siloDetails,
     SerializationManager serializationManager,
     ITelemetryProducer telemetryProducer,
     IHostEnvironmentStatistics hostEnvironmentStatistics,
     IAppEnvironmentStatistics appEnvironmentStatistics,
     ILoggerFactory loggerFactory,
     IOptions <SiloMessagingOptions> messagingOptions)
 {
     this.siloDetails    = siloDetails;
     this.storageOptions = azureStorageOptions.Value;
     MessagingStatisticsGroup.Init(true);
     MessagingProcessingStatisticsGroup.Init();
     NetworkingStatisticsGroup.Init(true);
     ApplicationRequestsStatisticsGroup.Init(messagingOptions.Value.ResponseTimeout);
     SchedulerStatisticsGroup.Init(loggerFactory);
     StorageStatisticsGroup.Init();
     TransactionsStatisticsGroup.Init();
     this.logger = loggerFactory.CreateLogger <SiloStatisticsManager>();
     this.hostEnvironmentStatistics = hostEnvironmentStatistics;
     this.logStatistics             = new LogStatistics(statisticsOptions.Value.LogWriteInterval, true, serializationManager, loggerFactory);
     this.MetricsTable      = new SiloPerformanceMetrics(this.hostEnvironmentStatistics, appEnvironmentStatistics, loggerFactory, loadSheddingOptions);
     this.countersPublisher = new CountersStatistics(statisticsOptions.Value.PerfCountersWriteInterval, telemetryProducer, loggerFactory);
 }
Ejemplo n.º 2
0
 public DeploymentLoadPublisher(
     ILocalSiloDetails siloDetails,
     ISiloStatusOracle siloStatusOracle,
     IOptions <DeploymentLoadPublisherOptions> options,
     IInternalGrainFactory grainFactory,
     OrleansTaskScheduler scheduler,
     ILoggerFactory loggerFactory,
     IMessageCenter messageCenter,
     ActivationDirectory activationDirectory,
     ActivationCollector activationCollector,
     IAppEnvironmentStatistics appEnvironmentStatistics,
     IHostEnvironmentStatistics hostEnvironmentStatistics,
     IOptions <LoadSheddingOptions> loadSheddingOptions)
     : base(Constants.DeploymentLoadPublisherSystemTargetId, siloDetails.SiloAddress, loggerFactory)
 {
     this.logger                    = loggerFactory.CreateLogger <DeploymentLoadPublisher>();
     this.siloDetails               = siloDetails;
     this.siloStatusOracle          = siloStatusOracle;
     this.grainFactory              = grainFactory;
     this.scheduler                 = scheduler;
     this.messageCenter             = messageCenter;
     this.activationDirectory       = activationDirectory;
     this.activationCollector       = activationCollector;
     this.appEnvironmentStatistics  = appEnvironmentStatistics;
     this.hostEnvironmentStatistics = hostEnvironmentStatistics;
     this.loadSheddingOptions       = loadSheddingOptions;
     statisticsRefreshTime          = options.Value.DeploymentLoadPublisherRefreshTime;
     periodicStats                  = new ConcurrentDictionary <SiloAddress, SiloRuntimeStatistics>();
     siloStatisticsChangeListeners  = new List <ISiloStatisticsChangeListener>();
 }
Ejemplo n.º 3
0
 public OrleansTaskSchedulerAdvancedTests_Set2(ITestOutputHelper output)
 {
     this.output             = output;
     this.loggerFactory      = OrleansTaskSchedulerBasicTests.InitSchedulerLogging();
     this.context            = new UnitTestSchedulingContext();
     this.performanceMetrics = new TestHooksHostEnvironmentStatistics();
 }
Ejemplo n.º 4
0
        internal static OrleansTaskScheduler InitializeSchedulerForTesting(
            ISchedulingContext context,
            IHostEnvironmentStatistics hostStatistics,
            ILoggerFactory loggerFactory)
        {
            var services = new ServiceCollection();

            services.AddOptions();
            services.AddLogging();
            services.AddSingleton <ExecutorService>();
            services.AddSingleton <SchedulerStatisticsGroup>();
            services.AddSingleton <StageAnalysisStatisticsGroup>();
            services.AddSingleton(loggerFactory);
            services.Configure <SchedulingOptions>(options =>
            {
                options.MaxActiveThreads            = 4;
                options.DelayWarningThreshold       = TimeSpan.FromMilliseconds(100);
                options.ActivationSchedulingQuantum = TimeSpan.FromMilliseconds(100);
                options.TurnWarningLengthThreshold  = TimeSpan.FromMilliseconds(100);
            });

            var serviceProvider = services.BuildServiceProvider();

            var scheduler = ActivatorUtilities.CreateInstance <OrleansTaskScheduler>(serviceProvider);

            scheduler.Start();
            WorkItemGroup ignore = scheduler.RegisterWorkContext(context);

            return(scheduler);
        }
Ejemplo n.º 5
0
 public OverloadDetector(IHostEnvironmentStatistics hostEnvironmentStatistics, IOptions <LoadSheddingOptions> loadSheddingOptions)
 {
     this.hostEnvironmentStatistics = hostEnvironmentStatistics;
     this.Enabled = loadSheddingOptions.Value.LoadSheddingEnabled;
     this.limit   = loadSheddingOptions.Value.LoadSheddingLimit;
     StringValueStatistic.FindOrCreate(StatisticNames.RUNTIME_IS_OVERLOADED, () => this.Overloaded.ToString());
 }
Ejemplo n.º 6
0
 internal WorkerPool(OrleansTaskScheduler sched, IHostEnvironmentStatistics hostStatistics, ExecutorService executorService, ILoggerFactory loggerFactory, int maxActiveThreads, bool enableWorkerThreadInjection)
 {
     scheduler                   = sched;
     this.hostStatistics         = hostStatistics;
     MaxActiveThreads            = maxActiveThreads;
     EnableWorkerThreadInjection = enableWorkerThreadInjection;
     MaxWorkQueueWait            = TimeSpan.FromMilliseconds(50);
     this.executorService        = executorService;
     this.loggerFactory          = loggerFactory;
     if (EnableWorkerThreadInjection)
     {
         threadLimitingSemaphore = new Semaphore(maxActiveThreads, maxActiveThreads);
     }
     pool = new HashSet <WorkerPoolThread>();
     createThreadCount = 0;
     lockable          = new object();
     for (createThreadCount = 0; createThreadCount < MaxActiveThreads; createThreadCount++)
     {
         var t = new WorkerPoolThread(this, scheduler, executorService, loggerFactory, hostStatistics, createThreadCount);
         pool.Add(t);
     }
     createThreadCount++;
     systemThread       = new WorkerPoolThread(this, scheduler, executorService, loggerFactory, hostStatistics, createThreadCount, true);
     running            = false;
     runningThreadCount = 0;
     longTurnTimer      = null;
     this.timerLogger   = loggerFactory.CreateLogger <SafeTimer>();
 }
Ejemplo n.º 7
0
        private OrleansTaskScheduler(int maxActiveThreads, TimeSpan delayWarningThreshold, TimeSpan activationSchedulingQuantum,
                                     TimeSpan turnWarningLengthThreshold, bool injectMoreWorkerThreads, int maxPendingItemsSoftLimit, int maxPendingItemsHardLimit,
                                     IHostEnvironmentStatistics hostStatistics, ExecutorService executorService, ILoggerFactory loggerFactory)
        {
            this.logger           = loggerFactory.CreateLogger <OrleansTaskScheduler>();
            this.loggerFactory    = loggerFactory;
            DelayWarningThreshold = delayWarningThreshold;
            WorkItemGroup.ActivationSchedulingQuantum = activationSchedulingQuantum;
            TurnWarningLengthThreshold    = turnWarningLengthThreshold;
            applicationTurnsStopped       = false;
            this.MaxPendingItemsSoftLimit = maxPendingItemsSoftLimit;
            this.MaxPendingItemsHardLimit = maxPendingItemsHardLimit;
            workgroupDirectory            = new ConcurrentDictionary <ISchedulingContext, WorkItemGroup>();
            RunQueue = new WorkQueue();
            this.taskWorkItemLogger = loggerFactory.CreateLogger <TaskWorkItem>();
            logger.Info("Starting OrleansTaskScheduler with {0} Max Active application Threads and 1 system thread.", maxActiveThreads);
            Pool = new WorkerPool(this, hostStatistics, executorService, loggerFactory, maxActiveThreads, injectMoreWorkerThreads);
            IntValueStatistic.FindOrCreate(StatisticNames.SCHEDULER_WORKITEMGROUP_COUNT, () => WorkItemGroupCount);
            IntValueStatistic.FindOrCreate(new StatisticName(StatisticNames.QUEUES_QUEUE_SIZE_INSTANTANEOUS_PER_QUEUE, "Scheduler.LevelOne"), () => RunQueueLength);

            if (!StatisticsCollector.CollectShedulerQueuesStats)
            {
                return;
            }

            FloatValueStatistic.FindOrCreate(new StatisticName(StatisticNames.QUEUES_QUEUE_SIZE_AVERAGE_PER_QUEUE, "Scheduler.LevelTwo.Average"), () => AverageRunQueueLengthLevelTwo);
            FloatValueStatistic.FindOrCreate(new StatisticName(StatisticNames.QUEUES_ENQUEUED_PER_QUEUE, "Scheduler.LevelTwo.Average"), () => AverageEnqueuedLevelTwo);
            FloatValueStatistic.FindOrCreate(new StatisticName(StatisticNames.QUEUES_AVERAGE_ARRIVAL_RATE_PER_QUEUE, "Scheduler.LevelTwo.Average"), () => AverageArrivalRateLevelTwo);
            FloatValueStatistic.FindOrCreate(new StatisticName(StatisticNames.QUEUES_QUEUE_SIZE_AVERAGE_PER_QUEUE, "Scheduler.LevelTwo.Sum"), () => SumRunQueueLengthLevelTwo);
            FloatValueStatistic.FindOrCreate(new StatisticName(StatisticNames.QUEUES_ENQUEUED_PER_QUEUE, "Scheduler.LevelTwo.Sum"), () => SumEnqueuedLevelTwo);
            FloatValueStatistic.FindOrCreate(new StatisticName(StatisticNames.QUEUES_AVERAGE_ARRIVAL_RATE_PER_QUEUE, "Scheduler.LevelTwo.Sum"), () => SumArrivalRateLevelTwo);
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LoadSheddingValidator"/> class.
 /// </summary>
 /// <param name="loadSheddingOptions">
 /// The load shedding options.
 /// </param>
 /// <param name="hostEnvironmentStatistics">
 /// The host environment statistics.
 /// </param>
 public LoadSheddingValidator(
     IOptions <LoadSheddingOptions> loadSheddingOptions,
     IHostEnvironmentStatistics hostEnvironmentStatistics
     )
 {
     _loadSheddingOptions       = loadSheddingOptions.Value;
     _hostEnvironmentStatistics = hostEnvironmentStatistics;
 }
Ejemplo n.º 9
0
 public OrleansTaskSchedulerBasicTests(ITestOutputHelper output)
 {
     this.output = output;
     SynchronizationContext.SetSynchronizationContext(null);
     this.loggerFactory      = InitSchedulerLogging();
     this.performanceMetrics = new TestHooksHostEnvironmentStatistics();
     this.rootContext        = new UnitTestSchedulingContext();
     this.scheduler          = TestInternalHelper.InitializeSchedulerForTesting(this.rootContext, this.performanceMetrics, this.loggerFactory);
 }
Ejemplo n.º 10
0
        private OrleansTaskScheduler(int maxActiveThreads, TimeSpan delayWarningThreshold, TimeSpan activationSchedulingQuantum,
                                     TimeSpan turnWarningLengthThreshold, bool injectMoreWorkerThreads, int maxPendingItemsSoftLimit, int maxPendingItemsHardLimit,
                                     IHostEnvironmentStatistics hostStatistics, ExecutorService executorService, ILoggerFactory loggerFactory)
        {
            this.loggerFactory      = loggerFactory;
            this.logger             = loggerFactory.CreateLogger <OrleansTaskScheduler>();
            cancellationTokenSource = new CancellationTokenSource();
            WorkItemGroup.ActivationSchedulingQuantum = activationSchedulingQuantum;
            applicationTurnsStopped       = false;
            TurnWarningLengthThreshold    = turnWarningLengthThreshold;
            this.MaxPendingItemsSoftLimit = maxPendingItemsSoftLimit;
            this.MaxPendingItemsHardLimit = maxPendingItemsHardLimit;
            workgroupDirectory            = new ConcurrentDictionary <ISchedulingContext, WorkItemGroup>();

            const int maxSystemThreads = 2;

            maximumConcurrencyLevel = maxActiveThreads + maxSystemThreads;

            OrleansSchedulerAsynchAgent CreateSchedulerAsynchAgent(string agentName, bool drainAfterCancel, int degreeOfParallelism)
            {
                return(new OrleansSchedulerAsynchAgent(
                           agentName,
                           executorService,
                           degreeOfParallelism,
                           delayWarningThreshold,
                           turnWarningLengthThreshold,
                           this,
                           drainAfterCancel,
                           loggerFactory));
            }

            mainAgent   = CreateSchedulerAsynchAgent("Scheduler.LevelOne.MainQueue", false, maxActiveThreads);
            systemAgent = CreateSchedulerAsynchAgent("Scheduler.LevelOne.SystemQueue", true, maxSystemThreads);

            this.taskWorkItemLogger = loggerFactory.CreateLogger <TaskWorkItem>();
            logger.Info("Starting OrleansTaskScheduler with {0} Max Active application Threads and 2 system thread.", maxActiveThreads);
            IntValueStatistic.FindOrCreate(StatisticNames.SCHEDULER_WORKITEMGROUP_COUNT, () => WorkItemGroupCount);
            IntValueStatistic.FindOrCreate(new StatisticName(StatisticNames.QUEUES_QUEUE_SIZE_INSTANTANEOUS_PER_QUEUE, "Scheduler.LevelOne"), () => RunQueueLength);

            if (!StatisticsCollector.CollectShedulerQueuesStats)
            {
                return;
            }

            FloatValueStatistic.FindOrCreate(new StatisticName(StatisticNames.QUEUES_QUEUE_SIZE_AVERAGE_PER_QUEUE, "Scheduler.LevelTwo.Average"), () => AverageRunQueueLengthLevelTwo);
            FloatValueStatistic.FindOrCreate(new StatisticName(StatisticNames.QUEUES_ENQUEUED_PER_QUEUE, "Scheduler.LevelTwo.Average"), () => AverageEnqueuedLevelTwo);
            FloatValueStatistic.FindOrCreate(new StatisticName(StatisticNames.QUEUES_AVERAGE_ARRIVAL_RATE_PER_QUEUE, "Scheduler.LevelTwo.Average"), () => AverageArrivalRateLevelTwo);
            FloatValueStatistic.FindOrCreate(new StatisticName(StatisticNames.QUEUES_QUEUE_SIZE_AVERAGE_PER_QUEUE, "Scheduler.LevelTwo.Sum"), () => SumRunQueueLengthLevelTwo);
            FloatValueStatistic.FindOrCreate(new StatisticName(StatisticNames.QUEUES_ENQUEUED_PER_QUEUE, "Scheduler.LevelTwo.Sum"), () => SumEnqueuedLevelTwo);
            FloatValueStatistic.FindOrCreate(new StatisticName(StatisticNames.QUEUES_AVERAGE_ARRIVAL_RATE_PER_QUEUE, "Scheduler.LevelTwo.Sum"), () => SumArrivalRateLevelTwo);
        }
Ejemplo n.º 11
0
 public static OrleansTaskScheduler CreateTestInstance(int maxActiveThreads, IHostEnvironmentStatistics hostStatistics, ILoggerFactory loggerFactory)
 {
     return(new OrleansTaskScheduler(
                maxActiveThreads,
                TimeSpan.FromMilliseconds(100),
                TimeSpan.FromMilliseconds(100),
                TimeSpan.FromMilliseconds(100),
                SchedulingOptions.DEFAULT_ENABLE_WORKER_THREAD_INJECTION,
                SchedulingOptions.DEFAULT_MAX_PENDING_ITEMS_SOFT_LIMIT,
                SchedulingOptions.DEFAULT_MAX_PENDING_ITEMS_HARD_LIMIT,
                hostStatistics,
                new ExecutorService(),
                loggerFactory));
 }
 internal SiloPerformanceMetrics(
     IHostEnvironmentStatistics hostEnvironmentStatistics,
     IAppEnvironmentStatistics appEnvironmentStatistics,
     ILoggerFactory loggerFactory,
     NodeConfiguration cfg = null)
 {
     this.loggerFactory             = loggerFactory;
     this.hostEnvironmentStatistics = hostEnvironmentStatistics;
     this.appEnvironmentStatistics  = appEnvironmentStatistics;
     reportFrequency = TimeSpan.Zero;
     overloadLatched = false;
     overloadValue   = false;
     this.logger     = loggerFactory.CreateLogger <SiloPerformanceMetrics>();
     NodeConfig      = cfg ?? new NodeConfiguration();
     StringValueStatistic.FindOrCreate(StatisticNames.RUNTIME_IS_OVERLOADED, () => IsOverloaded.ToString());
 }
Ejemplo n.º 13
0
 internal SiloPerformanceMetrics(
     IHostEnvironmentStatistics hostEnvironmentStatistics,
     IAppEnvironmentStatistics appEnvironmentStatistics,
     ILoggerFactory loggerFactory,
     IOptions <SiloStatisticsOptions> statisticsOptions)
 {
     this.loggerFactory             = loggerFactory;
     this.hostEnvironmentStatistics = hostEnvironmentStatistics;
     this.appEnvironmentStatistics  = appEnvironmentStatistics;
     reportFrequency        = TimeSpan.Zero;
     overloadLatched        = false;
     overloadValue          = false;
     this.logger            = loggerFactory.CreateLogger <SiloPerformanceMetrics>();
     this.statisticsOptions = statisticsOptions.Value;
     StringValueStatistic.FindOrCreate(StatisticNames.RUNTIME_IS_OVERLOADED, () => IsOverloaded.ToString());
 }
Ejemplo n.º 14
0
 internal ClientTableStatistics(
     IMessageCenter mc,
     IClientMetricsDataPublisher metricsDataPublisher,
     IHostEnvironmentStatistics hostEnvironmentStatistics,
     IAppEnvironmentStatistics appEnvironmentStatistics,
     ILoggerFactory loggerFactory)
 {
     this.mc = mc;
     this.metricsDataPublisher = metricsDataPublisher;
     this.logger = loggerFactory.CreateLogger <ClientTableStatistics>();
     //async timer created through current class all share this logger for perf reasons
     this.timerLogger = loggerFactory.CreateLogger <AsyncTaskSafeTimer>();
     this.hostEnvironmentStatistics = hostEnvironmentStatistics;
     this.appEnvironmentStatistics  = appEnvironmentStatistics;
     reportFrequency       = TimeSpan.Zero;
     connectedGatewayCount = IntValueStatistic.Find(StatisticNames.CLIENT_CONNECTED_GATEWAY_COUNT);
 }
Ejemplo n.º 15
0
        public SiloControl(
            ILocalSiloDetails localSiloDetails,
            DeploymentLoadPublisher deploymentLoadPublisher,
            Catalog catalog,
            CachedVersionSelectorManager cachedVersionSelectorManager,
            CompatibilityDirectorManager compatibilityDirectorManager,
            VersionSelectorManager selectorManager,
            IServiceProvider services,
            ILoggerFactory loggerFactory,
            IMessageCenter messageCenter,
            ActivationCollector activationCollector,
            ActivationDirectory activationDirectory,
            IActivationWorkingSet activationWorkingSet,
            IAppEnvironmentStatistics appEnvironmentStatistics,
            IHostEnvironmentStatistics hostEnvironmentStatistics,
            IOptions <LoadSheddingOptions> loadSheddingOptions,
            GrainCountStatistics grainCountStatistics)
            : base(Constants.SiloControlType, localSiloDetails.SiloAddress, loggerFactory)
        {
            this.localSiloDetails = localSiloDetails;

            this.logger = loggerFactory.CreateLogger <SiloControl>();
            this.deploymentLoadPublisher = deploymentLoadPublisher;
            this.catalog = catalog;
            this.cachedVersionSelectorManager = cachedVersionSelectorManager;
            this.compatibilityDirectorManager = compatibilityDirectorManager;
            this.selectorManager           = selectorManager;
            _activationCollector           = activationCollector;
            this.activationDirectory       = activationDirectory;
            this.activationWorkingSet      = activationWorkingSet;
            this.appEnvironmentStatistics  = appEnvironmentStatistics;
            this.hostEnvironmentStatistics = hostEnvironmentStatistics;
            this.loadSheddingOptions       = loadSheddingOptions;
            _grainCountStatistics          = grainCountStatistics;
            this.controllables             = new Dictionary <Tuple <string, string>, IControllable>();
            IEnumerable <IKeyedServiceCollection <string, IControllable> > namedIControllableCollections = services.GetServices <IKeyedServiceCollection <string, IControllable> >();

            foreach (IKeyedService <string, IControllable> keyedService in namedIControllableCollections.SelectMany(c => c.GetServices(services)))
            {
                IControllable controllable = keyedService.GetService(services);
                if (controllable != null)
                {
                    this.controllables.Add(Tuple.Create(controllable.GetType().FullName, keyedService.Key), controllable);
                }
            }
        }
Ejemplo n.º 16
0
        public MicrodotIncomingGrainCallFilter(
            IEventPublisher <GrainCallEvent> eventPublisher,
            Func <LoadShedding> loadSheddingConfig,
            ILog log,
            ClusterIdentity clusterIdentity,
            Func <GrainLoggingConfig> grainLoggingConfig,
            IHostEnvironmentStatistics hostEnvironmentStatistics)
        {
            _log                = log;
            _clusterIdentity    = clusterIdentity;
            _grainLoggingConfig = grainLoggingConfig;

            _eventPublisher            = eventPublisher;
            _loadSheddingConfig        = loadSheddingConfig;
            _hostEnvironmentStatistics = hostEnvironmentStatistics;

            DropEvent = Metric.Context("Silo").Meter("LoadShedding Drop Event", Unit.Items);
        }
Ejemplo n.º 17
0
 internal WorkerPoolThread(WorkerPool gtp, OrleansTaskScheduler sched, ExecutorService executorService, ILoggerFactory loggerFactory, IHostEnvironmentStatistics hostEnvironmentStatistics, int threadNumber, bool system = false)
     : base((system ? "System." : "") + threadNumber, executorService, loggerFactory)
 {
     pool      = gtp;
     scheduler = sched;
     this.hostEnvironmentStatistics = hostEnvironmentStatistics;
     ownsSemaphore          = false;
     IsSystem               = system;
     maxWorkQueueWait       = IsSystem ? Constants.INFINITE_TIMESPAN : gtp.MaxWorkQueueWait;
     OnFault                = FaultBehavior.IgnoreFault;
     currentWorkItemStarted = DateTime.UtcNow;
     currentTaskStarted     = DateTime.UtcNow;
     CurrentWorkItem        = null;
     if (StatisticsCollector.CollectTurnsStats)
     {
         WorkerThreadStatisticsNumber = SchedulerStatisticsGroup.RegisterWorkingThread(Name);
     }
 }
Ejemplo n.º 18
0
 internal SiloRuntimeStatistics(
     int activationCount,
     int recentlyUsedActivationCount,
     IAppEnvironmentStatistics appEnvironmentStatistics,
     IHostEnvironmentStatistics hostEnvironmentStatistics,
     IOptions <LoadSheddingOptions> loadSheddingOptions,
     DateTime dateTime)
 {
     ActivationCount             = activationCount;
     RecentlyUsedActivationCount = recentlyUsedActivationCount;
     CpuUsage            = hostEnvironmentStatistics.CpuUsage;
     AvailableMemory     = hostEnvironmentStatistics.AvailableMemory;
     MemoryUsage         = appEnvironmentStatistics.MemoryUsage;
     IsOverloaded        = loadSheddingOptions.Value.LoadSheddingEnabled && this.CpuUsage > loadSheddingOptions.Value.LoadSheddingLimit;
     ClientCount         = MessagingStatisticsGroup.ConnectedClientCount.GetCurrentValue();
     TotalPhysicalMemory = hostEnvironmentStatistics.TotalPhysicalMemory;
     ReceivedMessages    = MessagingStatisticsGroup.MessagesReceived.GetCurrentValue();
     SentMessages        = MessagingStatisticsGroup.MessagesSentTotal.GetCurrentValue();
     DateTime            = dateTime;
 }
Ejemplo n.º 19
0
 public ClientStatisticsManager(
     ClientConfiguration config,
     SerializationManager serializationManager,
     IServiceProvider serviceProvider,
     IHostEnvironmentStatistics hostEnvironmentStatistics,
     IAppEnvironmentStatistics appEnvironmentStatistics,
     ILoggerFactory loggerFactory,
     IOptions <ClientStatisticsOptions> statisticsOptions,
     IOptions <ClusterClientOptions> clusterClientOptions)
 {
     this.config                    = config;
     this.statisticsOptions         = statisticsOptions.Value;
     this.serviceProvider           = serviceProvider;
     this.hostEnvironmentStatistics = hostEnvironmentStatistics;
     this.appEnvironmentStatistics  = appEnvironmentStatistics;
     this.clusterClientOptions      = clusterClientOptions.Value;
     logStatistics                  = new LogStatistics(this.statisticsOptions.LogWriteInterval, false, serializationManager, loggerFactory);
     logger             = loggerFactory.CreateLogger <ClientStatisticsManager>();
     this.loggerFactory = loggerFactory;
     MessagingStatisticsGroup.Init(false);
     NetworkingStatisticsGroup.Init(false);
     ApplicationRequestsStatisticsGroup.Init(config.ResponseTimeout);
 }
Ejemplo n.º 20
0
 public MemoryPressureMonitor(IHostEnvironmentStatistics stats, IOptions <MemoryGovernanceOptions> options)
 {
     _stats   = stats ?? throw new ArgumentNullException(nameof(stats));
     _options = options?.Value ?? throw new ArgumentNullException(nameof(options));
 }
Ejemplo n.º 21
0
 public MemoryHealthCheckGrain(IHostEnvironmentStatistics hostEnvironmentStatistics)
 {
     _hostEnvironmentStatistics = hostEnvironmentStatistics;
 }
Ejemplo n.º 22
0
        internal static OrleansTaskScheduler InitializeSchedulerForTesting(ISchedulingContext context, IHostEnvironmentStatistics hostStatistics, ILoggerFactory loggerFactory)
        {
            StatisticsCollector.StatisticsCollectionLevel = StatisticsLevel.Info;
            SchedulerStatisticsGroup.Init(loggerFactory);
            var scheduler = OrleansTaskScheduler.CreateTestInstance(4, hostStatistics, loggerFactory);

            scheduler.Start();
            WorkItemGroup ignore = scheduler.RegisterWorkContext(context);

            return(scheduler);
        }
Ejemplo n.º 23
0
 public OrleansTaskScheduler(IOptions <SchedulingOptions> options, IHostEnvironmentStatistics hostStatistics, ExecutorService executorService, ILoggerFactory loggerFactory)
     : this(options.Value.MaxActiveThreads, options.Value.DelayWarningThreshold, options.Value.ActivationSchedulingQuantum,
            options.Value.TurnWarningLengthThreshold, options.Value.EnableWorkerThreadInjection, options.Value.MaxPendingWorkItemsSoftLimit,
            options.Value.MaxPendingWorkItemsHardLimit, hostStatistics, executorService, loggerFactory)
 {
 }