You are here

function _memcache_admin_stats_transfer in Memcache API and Integration 7

Same name and namespace in other branches
  1. 6 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 memcache_admin/memcache_admin.module
Callback for the Memcache Stats page.

File

memcache_admin/memcache_admin.module, line 199
For the collection and display of memcache stats.

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