@Override
    protected CacheStatistics[] getStatistics() {
        val statsList = new ArrayList<CacheStatistics>();
        try {
            val client = getClientFromPool();
            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 InetSocketAddress
                            ? ((InetSocketAddress) key).getHostName()
                            : key.toString();
                        statsList.add(new SimpleCacheStatistics(size, capacity, evictions, name));
                    }
                });
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
        }

        return statsList.toArray(CacheStatistics[]::new);
    }
@ Override protected CacheStatistics [ ] getStatistics ( ) { val statsList = new ArrayList < CacheStatistics > ( ) ; try { val client = getClientFromPool ( ) ; 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 InetSocketAddress ? ( ( InetSocketAddress ) key ) . getHostName ( ) : key . toString ( ) ; statsList . add ( new SimpleCacheStatistics ( size , capacity , evictions , name ) ) ; } } ) ; } catch ( final Exception e ) { LOGGER . error ( e . getMessage ( ) , e ) ; } return statsList . toArray ( CacheStatistics [ ] :: new ) ; }
Get cache statistics for all memcached hosts known to {@link MemcachedClientIF}.

@return Statistics for all available hosts.