2013-06-24 14:11:49 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Part of Munin PHP OPcache plugin - Refer to php_opcache for installation instructions.
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (function_exists('opcache_get_status'))
|
|
|
|
{
|
2017-01-05 14:49:37 +01:00
|
|
|
$data = opcache_get_status(false);
|
2013-06-24 14:11:49 +02:00
|
|
|
$output = array(
|
|
|
|
'mem_used.value' => $data['memory_usage']['used_memory'],
|
|
|
|
'mem_free.value' => $data['memory_usage']['free_memory'],
|
2015-03-26 19:03:11 +01:00
|
|
|
'mem_wasted.value' => $data['memory_usage']['wasted_memory'],
|
2013-06-24 14:11:49 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// OPCache not installed :(
|
|
|
|
$output = array(
|
|
|
|
'mem_used.value' => 0,
|
|
|
|
'mem_free.value' => 0,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
header('Content-Type: text/plain');
|
|
|
|
foreach ($output as $key => $value)
|
|
|
|
{
|
2013-06-24 14:18:30 +02:00
|
|
|
echo $key, ' ', $value, "\n";
|
2013-06-24 14:11:49 +02:00
|
|
|
}
|
|
|
|
?>
|