private BiConsumer<Region<?, ?>, Health.Builder> withRegionStatisticsDetails() {
return (region, builder) -> {
String regionName = region.getName();
Optional.of(region)
.filter(this::isNotLocalDataSet)
.filter(this::isStatisticsEnabled)
.map(RegionStatisticsResolver::resolve)
.ifPresent(cacheStatistics -> builder
.withDetail(cacheRegionStatisticsKey(regionName, "cache-statistics-type"), nullSafeClassName(cacheStatistics.getClass()))
.withDetail(cacheRegionStatisticsKey(regionName, "hit-count"), cacheStatistics.getHitCount())
.withDetail(cacheRegionStatisticsKey(regionName, "hit-ratio"), cacheStatistics.getHitRatio())
.withDetail(cacheRegionStatisticsKey(regionName, "last-accessed-time"), cacheStatistics.getLastAccessedTime())
.withDetail(cacheRegionStatisticsKey(regionName, "last-modified-time"), cacheStatistics.getLastModifiedTime())
.withDetail(cacheRegionStatisticsKey(regionName, "miss-count"), cacheStatistics.getMissCount()));
};
}