Skip to content

Instantly share code, notes, and snippets.

@maverick193
Created December 22, 2014 14:18
Show Gist options
  • Save maverick193/a5d63de497723d5ccc86 to your computer and use it in GitHub Desktop.
Save maverick193/a5d63de497723d5ccc86 to your computer and use it in GitHub Desktop.
Memcached et Can't get filling percentage
if ($memSize === null || $memUsed === null) {
$mem = $this->_memcache->getstats();
if (isset($mem['limit_maxbytes']) && $mem['limit_maxbytes'] > 0) {
return ((int) (100 * ($mem['bytes'] / $mem['limit_maxbytes'])));
} else {
return 100;
}
//ne renvoie plus d'exception
//Zend_Cache::throwException('Can\'t get filling percentage');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment