munin_apc.module 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. // $Id$
  3. /**
  4. * @file
  5. * APC instrumentation for Munin
  6. */
  7. /**
  8. * Implements hook_munin_api_info().
  9. *
  10. * @return
  11. * An array of Munin probes informations, index by probe name.
  12. */
  13. function munin_apc_munin_api_info() {
  14. $ret = array(
  15. 'munin_apc' => array(
  16. '#title' => t('PHP APC'),
  17. '#description' => t('Collect cache information for the Alternative PHP Cache'),
  18. 'uptime' => array(
  19. '#title' => t('Up-time of APC instance'),
  20. '#type' => MUNIN_API_GAUGE
  21. ),
  22. 'total_size' => array(
  23. '#title' => t('Number of bytes allocated to APC'),
  24. '#type' => MUNIN_API_COUNTER,
  25. ),
  26. 'used_size' => array(
  27. '#title' => t('Number of bytes currently used by APC, either cached or deleted'),
  28. '#type' => MUNIN_API_COUNTER,
  29. ),
  30. 'num_hits' => array(
  31. '#title' => t('The number of hits since the last restart'),
  32. '#type' => MUNIN_API_COUNTER,
  33. ),
  34. 'num_misses' => array(
  35. '#title' => t('The number of misses since the last restart'),
  36. '#type' => MUNIN_API_COUNTER,
  37. ),
  38. 'hit_rate' => array(
  39. '#title' => t('This hit/miss ratio since the last restart'),
  40. '#type' => MUNIN_API_GAUGE,
  41. ),
  42. 'num_insertions' => array(
  43. '#title' => t('The number of insertions since the last restart'),
  44. '#type' => MUNIN_API_COUNTER,
  45. ),
  46. 'cache_entries' => array(
  47. '#title' => t('The number of cache entries'),
  48. '#type' => MUNIN_API_GAUGE,
  49. ),
  50. 'deleted_entries' => array(
  51. '#title' => t('The number of deleted entries lingering'),
  52. '#type' => MUNIN_API_GAUGE,
  53. ),
  54. ),
  55. );
  56. return $ret;
  57. }
  58. /**
  59. * Implements hook_munin_api_fetch().
  60. */
  61. function munin_apc_munin_api_fetch() {
  62. return array(
  63. 'uptime' => 1,
  64. );
  65. }
  66. /**
  67. * Implements hook_munin_api_config().
  68. */
  69. function munin_apc_munin_api_config() {
  70. return array(
  71. );
  72. }