Exemple #1
0
        // Token: 0x060071F1 RID: 29169 RVA: 0x00179CB8 File Offset: 0x00177EB8
        protected override T CreateOnCacheMiss(BudgetKey key, ref bool shouldAdd)
        {
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }
            IThrottlingPolicy throttlingPolicy = null;
            LookupBudgetKey   lookupBudgetKey  = key as LookupBudgetKey;

            if (lookupBudgetKey != null)
            {
                throttlingPolicy = lookupBudgetKey.Lookup();
            }
            if (throttlingPolicy == null)
            {
                ExTraceGlobals.ClientThrottlingTracer.TraceDebug <string>((long)this.GetHashCode(), "[BudgetCache.CreateOnCacheMiss] Using global policy for account: {0}", key.ToString());
                throttlingPolicy = ThrottlingPolicyCache.Singleton.GetGlobalThrottlingPolicy();
            }
            T result = this.CreateBudget(key, throttlingPolicy);

            ThrottlingPerfCounterWrapper.IncrementBudgetCount();
            Interlocked.Increment(ref this.cacheMisses);
            return(result);
        }