File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1818using System . Threading ;
1919using System . Threading . Tasks ;
2020using BitFaster . Caching . Buffers ;
21+ using BitFaster . Caching . Concurrent ;
2122using BitFaster . Caching . Lru ;
2223using BitFaster . Caching . Scheduler ;
2324
@@ -204,7 +205,7 @@ public bool TryGet(K key, out V value)
204205 return true ;
205206 }
206207
207- Interlocked . Increment ( ref this . metrics . requestMissCount ) ;
208+ this . metrics . requestMissCount . Increment ( ) ;
208209
209210 value = default ;
210211 return false ;
@@ -706,17 +707,17 @@ internal string Format()
706707 internal class CacheMetrics : ICacheMetrics
707708 {
708709 public long requestHitCount ;
709- public long requestMissCount ;
710+ public LongAdder requestMissCount = new LongAdder ( ) ;
710711 public long updatedCount ;
711712 public long evictedCount ;
712713
713714 public double HitRatio => ( double ) requestHitCount / ( double ) Total ;
714715
715- public long Total => requestHitCount + requestMissCount ;
716+ public long Total => requestHitCount + requestMissCount . Sum ( ) ;
716717
717718 public long Hits => requestHitCount ;
718719
719- public long Misses => requestMissCount ;
720+ public long Misses => requestMissCount . Sum ( ) ;
720721
721722 public long Updated => updatedCount ;
722723
You can’t perform that action at this time.
0 commit comments