|
|
@ -37,8 +37,9 @@ public class EhCacheStatisticsProvider implements CacheStatisticsProvider<EhCach
|
|
|
|
statistics.setSize(ehCacheStatistics.getSize());
|
|
|
|
statistics.setSize(ehCacheStatistics.getSize());
|
|
|
|
Double hitRatio = ehCacheStatistics.cacheHitRatio();
|
|
|
|
Double hitRatio = ehCacheStatistics.cacheHitRatio();
|
|
|
|
if (!hitRatio.isNaN()) {
|
|
|
|
if (!hitRatio.isNaN()) {
|
|
|
|
// ratio is calculated 'racily' and can drift marginally above unity, so we cap it here
|
|
|
|
// ratio is calculated 'racily' and can drift marginally above unity,
|
|
|
|
double sanitizedHitRatio = hitRatio > 1 ? 1 : hitRatio;
|
|
|
|
// so we cap it here
|
|
|
|
|
|
|
|
double sanitizedHitRatio = (hitRatio > 1 ? 1 : hitRatio);
|
|
|
|
statistics.setHitRatio(sanitizedHitRatio);
|
|
|
|
statistics.setHitRatio(sanitizedHitRatio);
|
|
|
|
statistics.setMissRatio(1 - sanitizedHitRatio);
|
|
|
|
statistics.setMissRatio(1 - sanitizedHitRatio);
|
|
|
|
}
|
|
|
|
}
|
|
|
|