function _memcache_admin_stats_memory in Memcache API and Integration 7
Same name and namespace in other branches
- 6 memcache_admin/memcache_admin.module \_memcache_admin_stats_memory()
Statistics report: calculate available memory.
1 call to _memcache_admin_stats_memory()
- memcache_admin_stats in memcache_admin/
memcache_admin.module - Callback for the Memcache Stats page.
File
- memcache_admin/
memcache_admin.module, line 231 - For the collection and display of memcache stats.
Code
function _memcache_admin_stats_memory($stats) {
if ($stats['limit_maxbytes'] == 0) {
$percent = 0;
}
else {
$percent = 100 - $stats['bytes'] / $stats['limit_maxbytes'] * 100;
}
return t('!available (!percent%) of !total', array(
'!available' => format_size($stats['limit_maxbytes'] - $stats['bytes']),
'!percent' => number_format($percent, 2),
'!total' => format_size($stats['limit_maxbytes']),
));
}