You are here

function _memcache_admin_stats_percent in Memcache API and Integration 6

Same name and namespace in other branches
  1. 7 memcache_admin/memcache_admin.module \_memcache_admin_stats_percent()

Helper function. Calculate a percentage.

1 call to _memcache_admin_stats_percent()
memcache_admin_shutdown in memcache_admin/memcache_admin.module
See memcache_admin_init() which registers this function as a shutdown function. Displays memcache stats in the footer.

File

memcache_admin/memcache_admin.module, line 532

Code

function _memcache_admin_stats_percent($a, $b) {
  if ($a == 0) {
    return 0;
  }
  elseif ($b == 0) {
    return 100;
  }
  else {
    return $a / ($a + $b) * 100;
  }
}