// Token: 0x0600729D RID: 29341 RVA: 0x0017B774 File Offset: 0x00179974
 public static int DelayTimeThreshold(BudgetType budgetType)
 {
     return(DefaultThrottlingAlertValues.SafeGetValueFromMap(DefaultThrottlingAlertValues.delayTimeThresholdMap, budgetType, 10000));
 }
Пример #2
0
 public static void Initialize(BudgetType budgetType, int?massOverBudgetPercent, bool allowReinitialize)
 {
     if (ThrottlingPerfCounterWrapper.PerfCountersInitialized && !allowReinitialize)
     {
         throw new InvalidOperationException(string.Format("ThrottlingPerformanceCounters were already initialized with budget type of '{0}'.", ThrottlingPerfCounterWrapper.budgetType));
     }
     if (massOverBudgetPercent != null && (massOverBudgetPercent.Value < 0 || massOverBudgetPercent.Value > 100))
     {
         throw new ArgumentOutOfRangeException("massOverBudgetPercent", massOverBudgetPercent.Value, "massOverBudgetPercent must be between 0 and 100 inclusive");
     }
     ThrottlingPerfCounterWrapper.budgetType = budgetType;
     ThrottlingPerfCounterWrapper.massiveNumberOfUsersOverBudgetPercent = ((massOverBudgetPercent != null) ? massOverBudgetPercent.Value : DefaultThrottlingAlertValues.MassUserOverBudgetPercent(budgetType));
     try
     {
         string instanceName = ThrottlingPerfCounterWrapper.GetInstanceName(budgetType.ToString());
         ThrottlingPerfCounterWrapper.throttlingPerfCounters     = MSExchangeThrottling.GetInstance(instanceName);
         ThrottlingPerfCounterWrapper.userThrottlingPerfCounters = MSExchangeUserThrottling.GetInstance(instanceName);
         ThrottlingPerfCounterWrapper.PerfCountersInitialized    = true;
     }
     catch (Exception ex)
     {
         ThrottlingPerfCounterWrapper.PerfCountersInitialized = false;
         Globals.LogEvent(DirectoryEventLogConstants.Tuple_InitializePerformanceCountersFailed, string.Empty, new object[]
         {
             ex.ToString()
         });
         ExTraceGlobals.ClientThrottlingTracer.TraceError <string, string>(0L, "[ThrottlingPerfCounterWrapper.Initialize] Perf counter initialization failed with exception type: {0}, Messsage: {1}", ex.GetType().FullName, ex.Message);
     }
     ThrottlingPerfCounterWrapper.budgetsMicroDelayed = new ExactTimeoutCache <BudgetKey, BudgetKey>(delegate(BudgetKey key, BudgetKey value, RemoveReason reason)
     {
         ThrottlingPerfCounterWrapper.UpdateBudgetsMicroDelayed();
     }, null, null, 1000000, false, CacheFullBehavior.ExpireExisting);
     ThrottlingPerfCounterWrapper.budgetsAtMaximumDelay = new ExactTimeoutCache <BudgetKey, BudgetKey>(delegate(BudgetKey key, BudgetKey value, RemoveReason reason)
     {
         ThrottlingPerfCounterWrapper.UpdateBudgetsAtMaxDelay();
     }, null, null, 1000000, false, CacheFullBehavior.ExpireExisting);
     ThrottlingPerfCounterWrapper.budgetsLockedOut = new ExactTimeoutCache <BudgetKey, BudgetKey>(delegate(BudgetKey key, BudgetKey value, RemoveReason reason)
     {
         ThrottlingPerfCounterWrapper.UpdateBudgetsLockedOut();
     }, null, null, 1000000, false, CacheFullBehavior.ExpireExisting);
     ThrottlingPerfCounterWrapper.budgetsOverBudget = new ExactTimeoutCache <BudgetKey, BudgetKey>(delegate(BudgetKey key, BudgetKey value, RemoveReason reason)
     {
         ThrottlingPerfCounterWrapper.UpdateOverBudget();
     }, null, null, 1000000, false, CacheFullBehavior.ExpireExisting);
     ThrottlingPerfCounterWrapper.budgetsAtMaxConcurrency = new HashSet <BudgetKey>();
 }
 // Token: 0x0600729C RID: 29340 RVA: 0x0017B765 File Offset: 0x00179965
 public static int MassUserOverBudgetPercent(BudgetType budgetType)
 {
     return(DefaultThrottlingAlertValues.SafeGetValueFromMap(DefaultThrottlingAlertValues.massUserOverBudgetPercentMap, budgetType, 50));
 }