function _memcache_admin_stats_average in Memcache API and Integration 7
Same name and namespace in other branches
- 6 memcache_admin/memcache_admin.module \_memcache_admin_stats_average()
Statistics report: calculate per-connection averages.
1 call to _memcache_admin_stats_average()
- memcache_admin_stats in memcache_admin/
memcache_admin.module - Callback for the Memcache Stats page.
File
- memcache_admin/
memcache_admin.module, line 212 - For the collection and display of memcache stats.
Code
function _memcache_admin_stats_average($stats) {
if ($stats['total_connections'] == 0) {
$get = 0;
$set = 0;
$read = 0;
$write = 0;
}
else {
$get = $stats['cmd_get'] / $stats['total_connections'];
$set = $stats['cmd_set'] / $stats['total_connections'];
$read = $stats['bytes_written'] / $stats['total_connections'];
$write = $stats['bytes_read'] / $stats['total_connections'];
}
return t('!read in !get gets; !write in !set sets', array(
'!get' => number_format($get, 2),
'!set' => number_format($set, 2),
'!read' => format_size(number_format($read, 2)),
'!write' => format_size(number_format($write, 2)),
));
}