You are here

function _memcache_admin_stats_percent in Memcache API and Integration 7

Same name and namespace in other branches
  1. 6 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
Displays memcache stats in the footer. This is run as a shutdown function.

File

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

Code

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