$type_stat) { foreach($type_stat as $k => $v) { if(!in_array($k, $EXPORTED_STATS)) { continue; } if(!isset($total[$k])) { $total[$k] = 0; } $total[$k] += $v; } } return $total; } $code_cache_stats = xcache_type_stats(XC_TYPE_PHP); $var_cache_stats = xcache_type_stats(XC_TYPE_VAR); /* print var_dump($code_cache_stats); print var_dump($var_cache_stats); */ foreach($code_cache_stats as $k => $v) { print "xcache.stat{type=code,what=$k}: $v\n"; } foreach($var_cache_stats as $k => $v) { print "xcache.stat{type=var,what=$k}: $v\n"; } print "xcache.pid: " . getmypid(); ?>