Esempio n. 1
0
        public static void CleanUp(TimeSpan olderThan)
        {
            var cleanUpTimeIndex = TimeIndex.GetIndex(DateTime.Now - olderThan);

            foreach (var storage in storages)
            {
                storage.ClearCounters(i => i < cleanUpTimeIndex);
            }
        }
 private int GetTimeIndex()
 {
     try
     {
         return(TimeIndex.GetIndex(DateTime.Now));
     }
     catch (TimeIndexOverflowException)
     {
         _counters.Clear();
         TimeIndex.Reset();
         return(TimeIndex.GetIndex(DateTime.Now));
     }
 }