Esempio n. 1
0
        public StakhanoviseSetupDefaults GetDefaults()
        {
            int defaultWorkerCount = Math.Max(1, Environment.ProcessorCount - 1);

            StakhanoviseSetupDefaults defaults = new StakhanoviseSetupDefaults()
            {
                Mapping            = new QueuedTaskMapping(),
                ExecutorAssemblies = GetDefaultAssembliesToScan(),
                WorkerCount        = defaultWorkerCount,

                CalculateDelayMillisecondsTaskAfterFailure = token
                                                             => ( long )Math.Pow(10, token.LastQueuedTaskResult.ErrorCount + 1),

                IsTaskErrorRecoverable = (task, exc)
                                         => !(exc is NullReferenceException) &&
                                         !(exc is ArgumentException),

                FaultErrorThresholdCount = DefaultFaultErrorThresholdCount,
                AppMetricsCollectionIntervalMilliseconds = DefaultAppMetricsCollectionIntervalMilliseconds,
                AppMetricsMonitoringEnabled = true,
                SetupBuiltInDbAsssets       = true
            };

            return(defaults);
        }
Esempio n. 2
0
        public StandardConnectionSetup(StakhanoviseSetupDefaults defaults)
        {
            if (defaults == null)
            {
                throw new ArgumentNullException(nameof(defaults));
            }

            mConnectionString = defaults.ConnectionString;
        }
Esempio n. 3
0
        public StandardAppMetricsMonitorWriterSetup(StandardConnectionSetup builtInWriterConnectionSetup,
                                                    StakhanoviseSetupDefaults defaults)
        {
            if (defaults == null)
            {
                throw new ArgumentNullException(nameof(defaults));
            }

            mBuiltInWriterSetup = new StandardPostgreSqlAppMetricsMonitorWriterSetup(builtInWriterConnectionSetup,
                                                                                     defaults);
        }
        public StandardPostgreSqlExecutionPerformanceMonitorWriterSetup(StandardConnectionSetup connectionSetup,
                                                                        StakhanoviseSetupDefaults defaults)
        {
            mConnectionSetup = connectionSetup
                               ?? throw new ArgumentNullException(nameof(connectionSetup));

            if (defaults == null)
            {
                throw new ArgumentNullException(nameof(defaults));
            }

            mMapping = defaults.Mapping;
        }
        public StandardTaskProcessingSetup(StakhanoviseSetupDefaults defaults)
        {
            if (defaults == null)
            {
                throw new ArgumentNullException(nameof(defaults));
            }

            mCalculateDelayTicksTaskAfterFailure = defaults
                                                   .CalculateDelayMillisecondsTaskAfterFailure;
            mIsTaskErrorRecoverable = defaults
                                      .IsTaskErrorRecoverable;
            mFaultErrorThresholdCount = defaults
                                        .FaultErrorThresholdCount;
        }
        public StandardTaskQueueInfoSetup(StandardConnectionSetup connectionSetup,
                                          StakhanoviseSetupDefaults defaults)
        {
            if (connectionSetup == null)
            {
                throw new ArgumentNullException(nameof(connectionSetup));
            }

            if (defaults == null)
            {
                throw new ArgumentNullException(nameof(defaults));
            }

            mConnectionSetup = connectionSetup;
            mMapping         = defaults.Mapping;
        }
        public StandardTaskEngineSetup(StandardTaskQueueConsumerSetup taskQueueConsumerSetup, StakhanoviseSetupDefaults defaults)
        {
            if (taskQueueConsumerSetup == null)
            {
                throw new ArgumentNullException(nameof(taskQueueConsumerSetup));
            }

            if (defaults == null)
            {
                throw new ArgumentNullException(nameof(defaults));
            }

            mWorkerCount            = defaults.WorkerCount;
            mTaskProcessingSetup    = new StandardTaskProcessingSetup(defaults);
            mTaskQueueConsumerSetup = taskQueueConsumerSetup;
            mExecutorAssemblies     = defaults.ExecutorAssemblies;
        }
Esempio n. 8
0
        public StakhanoviseSetup(StakhanoviseSetupDefaults defaults)
        {
            if (defaults == null)
            {
                throw new ArgumentNullException(nameof(defaults));
            }

            mMapping = defaults.Mapping;

            mSetupBuiltInDbAsssets = defaults
                                     .SetupBuiltInDbAsssets;

            mAppMetricsMonitoringEnabled = defaults
                                           .AppMetricsMonitoringEnabled;

            StandardConnectionSetup queueConsumerConnectionSetup =
                new StandardConnectionSetup(defaults);

            StandardConnectionSetup queueProducerConnectionSetup =
                new StandardConnectionSetup(defaults);

            StandardConnectionSetup queueInfoConnectionSetup =
                new StandardConnectionSetup(defaults);

            StandardConnectionSetup builtInTimingBeltConnectionSetup =
                new StandardConnectionSetup(defaults);

            StandardConnectionSetup builtInWriterConnectionSetup =
                new StandardConnectionSetup(defaults);

            StandardConnectionSetup builtInAppMetricsWriterConnectionSetup =
                new StandardConnectionSetup(defaults);

            mSetupDbAssetsConnectionSetup =
                new StandardConnectionSetup(defaults);

            mTaskQueueProducerSetup = new StandardTaskQueueProducerSetup(queueProducerConnectionSetup,
                                                                         defaults);

            mTaskQueueInfoSetup = new StandardTaskQueueInfoSetup(queueInfoConnectionSetup,
                                                                 defaults);

            mCommonTaskQueueConnectionSetup = new CollectiveConnectionSetup(queueConsumerConnectionSetup,
                                                                            queueProducerConnectionSetup,
                                                                            queueInfoConnectionSetup,
                                                                            builtInTimingBeltConnectionSetup,
                                                                            builtInWriterConnectionSetup,
                                                                            builtInAppMetricsWriterConnectionSetup,
                                                                            mSetupDbAssetsConnectionSetup);

            mTaskQueueConsumerSetup = new StandardTaskQueueConsumerSetup(queueConsumerConnectionSetup,
                                                                         defaults);

            mTaskEngineSetup = new StandardTaskEngineSetup(mTaskQueueConsumerSetup,
                                                           defaults);

            mPerformanceMonitorWriterSetup = new StandardExecutionPerformanceMonitorWriterSetup(builtInWriterConnectionSetup,
                                                                                                defaults);

            mAppMetricsMonitorSetup = new StandardAppMetricsMonitorSetup(defaults);

            mAppMetricsMonitorWriterSetup = new StandardAppMetricsMonitorWriterSetup(builtInAppMetricsWriterConnectionSetup,
                                                                                     defaults);
        }
 public StandardAppMetricsMonitorSetup(StakhanoviseSetupDefaults defaults)
 {
     mCollectionIntervalMilliseconds = defaults.AppMetricsCollectionIntervalMilliseconds;
 }