-
Notifications
You must be signed in to change notification settings - Fork 31
Metrics
Alex Peck edited this page Sep 18, 2022
·
7 revisions
Metrics are disabled by default for ConcurrentLru
. By calling the builder method WithMetrics
you can turn on metrics.
ICache<int, int> lru = new ConcurrentLruBuilder<int, int>()
.WithMetrics()
.Build();
For ConcurrentLfu
metrics are always enabled since the buffered reads and writes mitigate any performance penalty.
To retrieve metrics from the cache, use the Metrics
property.
- Hit count
- Miss count
- Hit ratio
- Eviction count
- Update count
Internally metrics are implemented using the Counter
class. This is a .NET implementation of Java's LongAdder. This is a scalable counter class with very high concurrent throughput.