You are here

function _memcache_admin_stats_memory in Memcache API and Integration 6

Same name and namespace in other branches
  1. 7 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
Memcahe Stats page

File

memcache_admin/memcache_admin.module, line 210

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