@Override
    protected CacheStatistics[] getStatistics() {
        try {
            val client = getClientFromPool();
            val statsList = new ArrayList<CacheStatistics>(client.getStats().size());
            client.getStats()
                .forEach((key, statsMap) -> {
                    if (!statsMap.isEmpty()) {
                        val size = Long.parseLong(statsMap.get("bytes"));
                        val capacity = Long.parseLong(statsMap.get("limit_maxbytes"));
                        val evictions = Long.parseLong(statsMap.get("evictions"));

                        val name = key instanceof final InetSocketAddress socketAddress
                            ? socketAddress.getHostName()
                            : key.toString();
                        statsList.add(new SimpleCacheStatistics(size, capacity, evictions, name));
                    }
                });
            return statsList.toArray(CacheStatistics[]::new);
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        }
        return List.<CacheStatistics>of().toArray(CacheStatistics[]::new);
    }
Monitors the memcached hosts known to an instance of {@link MemcachedClientIF}.

@author Marvin S. Addison
@since 3.5.1
@deprecated Since 7.0.0
support/cas-server-support-memcached-monitor/src/main/java/org/apereo/cas/monitor/MemcachedHealthIndicator.java