You are here

function bsize in Production check & Production monitor 6

Same name in this branch
  1. 6 includes/prod_check.memcache.inc \bsize()
  2. 6 includes/prod_check.apc.inc \bsize()
Same name and namespace in other branches
  1. 7 includes/prod_check.memcache.inc \bsize()
  2. 7 includes/prod_check.apc.inc \bsize()
1 call to bsize()
prod_check.apc.inc in includes/prod_check.apc.inc

File

includes/prod_check.apc.inc, line 459

Code

function bsize($s) {
  foreach (array(
    '',
    'K',
    'M',
    'G',
  ) as $i => $k) {
    if ($s < 1024) {
      break;
    }
    $s /= 1024;
  }
  return sprintf("%5.1f %sBytes", $s, $k);
}