You are here

function _memcache_admin_stats_transfer in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 modules/memcache/memcache_admin/memcache_admin.module \_memcache_admin_stats_transfer()

Statistics report: calculate bytes transferred.

1 call to _memcache_admin_stats_transfer()
memcache_admin_stats in modules/memcache/memcache_admin/memcache_admin.module
Memcache Stats page

File

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

Code

function _memcache_admin_stats_transfer($stats) {
  if ($stats['bytes_written'] == 0) {
    $written = 0;
  }
  else {
    $written = $stats['bytes_read'] / $stats['bytes_written'] * 100;
  }
  return t('!to:!from (!written% to cache)', array(
    '!to' => format_size((int) $stats['bytes_read']),
    '!from' => format_size((int) $stats['bytes_written']),
    '!written' => number_format($written, 2),
  ));
}