Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / php / php_opcache.php @ e15ed8cb

Historique | Voir | Annoter | Télécharger (547 octets)

1
<?php
2
/**
3
 * Part of Munin PHP OPcache plugin - Refer to php_opcache for installation instructions.
4
 */
5

    
6
if (function_exists('opcache_get_status')) 
7
{
8
        $data = opcache_get_status();
9
        $output = array(
10
                'mem_used.value' => $data['memory_usage']['used_memory'],
11
                'mem_free.value' => $data['memory_usage']['free_memory'],
12
        );
13
}
14
else
15
{
16
        // OPCache not installed :(
17
        $output = array(
18
                'mem_used.value' => 0,
19
                'mem_free.value' => 0,
20
        );
21
}
22

    
23
header('Content-Type: text/plain');
24
foreach ($output as $key => $value)
25
{
26
        echo $key, ' ', $value, "\n";
27
}
28
?>