Ejemplo n.º 1
0
 public CacheStats Snapshot()
 {
     try
     {
         return(@delegate.Snapshot());
     }
     catch
     {
         return(CacheStats.EmptyStats);
     }
 }
Ejemplo n.º 2
0
        public void IncrementBy(IStatsCounter other)
        {
            CacheStats otherStats = other.Snapshot();

            Interlocked.Add(ref hitCount, (long)otherStats.HitCount);
            Interlocked.Add(ref missCount, (long)otherStats.MissCount);
            Interlocked.Add(ref loadSuccessCount, (long)otherStats.LoadSuccessCount);
            Interlocked.Add(ref loadFailureCount, (long)otherStats.LoadFailureCount);
            Interlocked.Add(ref totalLoadTime, (long)otherStats.TotalLoadTime);
            Interlocked.Add(ref evictionCount, (long)otherStats.EvictionCount);
            Interlocked.Add(ref evictionWeight, (long)otherStats.EvictionWeight);
        }