Projet

Général

Profil

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

root / plugins / php / php_opcache.php @ 17f78427

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

1 cde616b8 Daniel Lo Nigro
<?php
2
/**
3
 * Part of Munin PHP OPcache plugin - Refer to php_opcache for installation instructions.
4
 */
5
6 17f78427 Lars Kruse
if (function_exists('opcache_get_status'))
7 cde616b8 Daniel Lo Nigro
{
8 5b953697 Markus Staab
        $data = opcache_get_status(false);
9 cde616b8 Daniel Lo Nigro
        $output = array(
10
                'mem_used.value' => $data['memory_usage']['used_memory'],
11
                'mem_free.value' => $data['memory_usage']['free_memory'],
12 ec4951b7 Mikel Olasagasti Uranga
                'mem_wasted.value' => $data['memory_usage']['wasted_memory'],
13 cde616b8 Daniel Lo Nigro
        );
14
}
15
else
16
{
17
        // OPCache not installed :(
18
        $output = array(
19
                'mem_used.value' => 0,
20
                'mem_free.value' => 0,
21
        );
22
}
23
24
header('Content-Type: text/plain');
25
foreach ($output as $key => $value)
26
{
27 8a207575 Daniel Lo Nigro
        echo $key, ' ', $value, "\n";
28 cde616b8 Daniel Lo Nigro
}
29
?>