Example #1
0
 public ListCacheStats Since(ListCacheStats prior)
 {
     return(new ListCacheStats(
                Skipped - prior.Skipped,
                TotalResultItems - prior.TotalResultItems,
                PeakResultItems));
 }
Example #2
0
 private CacheStats withCacheNonHit(ListCacheStats newListStats, TimeSpan queryTime, bool isOverCapacity)
 {
     return(new CacheStats(StartStamp, Nrdo.GlobalStats, IsList, newListStats,
                           Hits,
                           NonHits + 1,
                           isOverCapacity ? NonHitsOverCapacity + 1 : NonHitsOverCapacity,
                           Failures,
                           CumulativeTime + NrdoStats.nonZeroTime(queryTime),
                           CumulativeFailureTime,
                           CumulativeCost,
                           ForeverNonHits + 1,
                           ForeverCumulativeTime + NrdoStats.nonZeroTime(queryTime)));
 }
Example #3
0
 private CacheStats withCacheHit(ListCacheStats newListStats)
 {
     return(new CacheStats(StartStamp, Nrdo.GlobalStats, IsList, newListStats,
                           Hits + 1, // New value
                           NonHits,
                           NonHitsOverCapacity,
                           Failures,
                           CumulativeTime,
                           CumulativeFailureTime,
                           CumulativeCost,
                           ForeverNonHits,
                           ForeverCumulativeTime));
 }
Example #4
0
 private CacheStats(TimeSpan startStamp, GlobalStats latestGlobalStats, bool isList, ListCacheStats listStats,
                    long hits, long nonHits, long nonHitsOverCapacity, long failures,
                    TimeSpan cumulativeTime, TimeSpan cumulativeFailureTime, long cumulativeCost,
                    long foreverNonHits, TimeSpan foreverCumulativeTime)
 {
     this.StartStamp        = startStamp;
     this.LatestGlobalStats = latestGlobalStats;
     this.IsList            = isList;
     this.ListStats         = listStats;
     this.Hits                  = hits;
     this.NonHits               = nonHits;
     this.NonHitsOverCapacity   = nonHitsOverCapacity;
     this.Failures              = failures;
     this.CumulativeTime        = cumulativeTime;
     this.CumulativeFailureTime = cumulativeFailureTime;
     this.CumulativeCost        = cumulativeCost;
     this.ForeverNonHits        = foreverNonHits;
     this.ForeverCumulativeTime = foreverCumulativeTime;
 }