Esempio n. 1
0
        internal bool IsStable(Type type)
        {
            if (TypeFailures.ContainsKey(type))
            {
                return(TypeFailures[type].Count < ErrorCount);
            }

            return(true);
        }
Esempio n. 2
0
        internal void AddFailure(Type type)
        {
            if (TypeFailures.ContainsKey(type))
            {
                TypeFailures[type].Add(DateTimeOffset.Now);
            }
            else
            {
                TypeFailures[type] = new List <DateTimeOffset> {
                    DateTimeOffset.Now
                };
            }

            // Trim the expired events
            TypeFailures[type].RemoveAll(x => x < DateTimeOffset.Now.Subtract(ErrorWindow));
        }