getStats example

return array();
    }

    /** * Return the filling percentage of the backend storage * * @throws Zend_Cache_Exception * @return int integer between 0 and 100 */
    public function getFillingPercentage()
    {
        $mems = $this->_memcache->getStats();
        if ($mems === false) {
            return 0;
        }

        $memSize = null;
        $memUsed = null;
        foreach ($mems as $key => $mem) {
            if ($mem === false) {
                $this->_log('can\'t get stat from ' . $key);
                continue;
            }

            
$this->memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, true);
                }

                // Add server                 $this->memcached->addServer(
                    $this->config['host'],
                    $this->config['port'],
                    $this->config['weight']
                );

                // attempt to get status of servers                 $stats = $this->memcached->getStats();

                // $stats should be an associate array with a key in the format of host:port.                 // If it doesn't have the key, we know the server is not working as expected.                 if (isset($stats[$this->config['host'] . ':' . $this->config['port']])) {
                    throw new CriticalError('Cache: Memcached connection failed.');
                }
            } elseif (class_exists(Memcache::class)) {
                // Create new instance of Memcache                 $this->memcached = new Memcache();

                // Check if we can connect to the server
Home | Imprint | This part of the site doesn't use cookies.