You are here

function _memcache_admin_stats_memory in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 modules/memcache/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 modules/memcache/memcache_admin/memcache_admin.module
Memcache Stats page

File

modules/memcache/memcache_admin/memcache_admin.module, line 208

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']),
  ));
}