public ServiceLevelAgreementMonitor(IServiceLevelAgreementProvider slaProvider, LoggingConfiguration slaConfiguration)
        {
            _slaProvider = slaProvider;

            logSlaBreach = slaConfiguration.ConfigureLoggingAction(Logger, slaConfiguration.LoggingLevelWhenSLAIsBreached);
            logSlaMet = slaConfiguration.ConfigureLoggingAction(Logger, slaConfiguration.LoggingLevelWhenSLAIsMet);
        }
        public ServiceLevelAgreementMonitor(IServiceLevelAgreementProvider slaProvider, LoggingConfiguration slaConfiguration)
        {
            _slaProvider = slaProvider;

            logSlaBreach = slaConfiguration.ConfigureLoggingAction(Logger, slaConfiguration.LoggingLevelWhenSLAIsBreached);
            logSlaMet    = slaConfiguration.ConfigureLoggingAction(Logger, slaConfiguration.LoggingLevelWhenSLAIsMet);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a SlaProvessor that uses given <c>provider</c> SlaProvider to determine which messages should be monitored.
        /// The <c>quotaPerMessageType</c> determines how many request messages of given type would be tracked at the same time (<see cref="QuotaPerMessageType"/> for details).
        /// </summary>
        /// <param name="provider">SlaProvider instance</param>
        /// <param name="quotaPerMessageType">The maximum number of request messages of given type that can be tracked at the same time.</param>
        /// <param name="loggingConfiguration">Specifies the log level for when SLA is met/breached</param>
        /// <param name="timeoutValidationSchedulerFactory">Timeout scheduler factory</param>
        protected internal SlaProcessor(SlaProvider provider, int quotaPerMessageType, LoggingConfiguration loggingConfiguration, Func<ISlaProcessor, IDisposable> timeoutValidationSchedulerFactory)
        {
            _provider = provider;
            QuotaPerMessageType = quotaPerMessageType;

            _logSlaBreach = loggingConfiguration.ConfigureLoggingAction(_logger, loggingConfiguration.LoggingLevelWhenSLAIsBreached);
            _logSlaMet = loggingConfiguration.ConfigureLoggingAction(_logger, loggingConfiguration.LoggingLevelWhenSLAIsMet);
            _timeoutValidationScheduler = timeoutValidationSchedulerFactory.Invoke(this);
        }