public GuardedStatsCounterSupplier(IStatsCounterSupplier <T> statsCounterSupplier)
 {
     supplier = statsCounterSupplier;
 }
Beispiel #2
0
 /// <summary>
 /// Enables the accumulation of <see cref="CacheStats"/> during the operation of the cache. Without this
 /// <see cref="ICache{K, V}.Stats"/> will return zero for all statistics. Note that recording statistics
 /// requires bookkeeping to be performed with each operation, and thus imposes a performance penalty
 /// on each cache operation.
 /// </summary>
 /// <param name="statsCounterSupplier">A supplier that returns a new <see cref="IStatsCounter"/></param>
 /// <returns></returns>
 public Caffeine <K, V> RecordStats <T>(IStatsCounterSupplier <T> statsCounterSupplier) where T : IStatsCounter
 {
     StatsCounter = new GuardedStatsCounterSupplier <IStatsCounter>((IStatsCounterSupplier <IStatsCounter>)statsCounterSupplier);
     return(this);
 }