class_debug.inc 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <?php
  2. // $Id: class_debug.inc,v 1.1 2002/12/29 16:19:36 dijkstra Exp $
  3. require_once("class_graph.inc");
  4. class DEBUG_Graph extends Graph {
  5. function DEBUG_Graph() {
  6. // get all the sensible defaults from our parent class
  7. $this->init();
  8. }
  9. function execute($url) {
  10. $this->url2options($url);
  11. // Four major display modes:
  12. // if=brief|bits|packets|all
  13. $this->shortcut = array_merge($this->shortcut, array(
  14. "debug" => array(
  15. "brief" => array(
  16. "dsdefinition" => array(
  17. 'DEF:d0='.$this->get("rrdfile").':debug0:AVERAGE'),
  18. "graphdefinition" => array(
  19. 'COMMENT:" min avg max last\n"',
  20. 'LINE1:d0#000000:"d0 "',
  21. 'GPRINT:d0:MIN:" %6.2lf "',
  22. 'GPRINT:d0:AVERAGE:"%6.2lf "',
  23. 'GPRINT:d0:MAX:"%6.2lf "',
  24. 'GPRINT:d0:LAST:"%6.2lf \n"')),
  25. "detailed" => array(
  26. "dsdefinition" => array(
  27. 'DEF:d0='.$this->get("rrdfile").':debug0:AVERAGE',
  28. 'DEF:d1='.$this->get("rrdfile").':debug1:AVERAGE',
  29. 'DEF:d2='.$this->get("rrdfile").':debug2:AVERAGE',
  30. 'DEF:d3='.$this->get("rrdfile").':debug3:AVERAGE',
  31. 'DEF:d4='.$this->get("rrdfile").':debug4:AVERAGE',
  32. 'DEF:d5='.$this->get("rrdfile").':debug5:AVERAGE',
  33. 'DEF:d6='.$this->get("rrdfile").':debug6:AVERAGE',
  34. 'DEF:d7='.$this->get("rrdfile").':debug7:AVERAGE',
  35. 'DEF:d8='.$this->get("rrdfile").':debug8:AVERAGE',
  36. 'DEF:d9='.$this->get("rrdfile").':debug9:AVERAGE',
  37. 'DEF:d10='.$this->get("rrdfile").':debug10:AVERAGE',
  38. 'DEF:d11='.$this->get("rrdfile").':debug11:AVERAGE',
  39. 'DEF:d12='.$this->get("rrdfile").':debug12:AVERAGE',
  40. 'DEF:d13='.$this->get("rrdfile").':debug13:AVERAGE',
  41. 'DEF:d14='.$this->get("rrdfile").':debug14:AVERAGE',
  42. 'DEF:d15='.$this->get("rrdfile").':debug15:AVERAGE',
  43. 'DEF:d16='.$this->get("rrdfile").':debug16:AVERAGE',
  44. 'DEF:d17='.$this->get("rrdfile").':debug17:AVERAGE',
  45. 'DEF:d18='.$this->get("rrdfile").':debug18:AVERAGE',
  46. 'DEF:d19='.$this->get("rrdfile").':debug19:AVERAGE'),
  47. "graphdefinition" => array(
  48. 'COMMENT:" min avg max last\n"',
  49. 'LINE1:d0#000000:"d0 "',
  50. 'GPRINT:d0:MIN:" %6.2lf "',
  51. 'GPRINT:d0:AVERAGE:"%6.2lf "',
  52. 'GPRINT:d0:MAX:"%6.2lf "',
  53. 'GPRINT:d0:LAST:"%6.2lf \n"',
  54. 'LINE1:d1#000111:"d1 "',
  55. 'GPRINT:d1:MIN:" %6.2lf "',
  56. 'GPRINT:d1:AVERAGE:"%6.2lf "',
  57. 'GPRINT:d1:MAX:"%6.2lf "',
  58. 'GPRINT:d1:LAST:"%6.2lf \n"',
  59. 'LINE1:d2#000222:"d2 "',
  60. 'GPRINT:d2:MIN:" %6.2lf "',
  61. 'GPRINT:d2:AVERAGE:"%6.2lf "',
  62. 'GPRINT:d2:MAX:"%6.2lf "',
  63. 'GPRINT:d2:LAST:"%6.2lf \n"',
  64. 'LINE1:d3#000333:"d3 "',
  65. 'GPRINT:d3:MIN:" %6.2lf "',
  66. 'GPRINT:d3:AVERAGE:"%6.2lf "',
  67. 'GPRINT:d3:MAX:"%6.2lf "',
  68. 'GPRINT:d3:LAST:"%6.2lf \n"',
  69. 'LINE1:d4#000444:"d4 "',
  70. 'GPRINT:d4:MIN:" %6.2lf "',
  71. 'GPRINT:d4:AVERAGE:"%6.2lf "',
  72. 'GPRINT:d4:MAX:"%6.2lf "',
  73. 'GPRINT:d4:LAST:"%6.2lf \n"',
  74. 'LINE1:d5#000555:"d5 "',
  75. 'GPRINT:d5:MIN:" %6.2lf "',
  76. 'GPRINT:d5:AVERAGE:"%6.2lf "',
  77. 'GPRINT:d5:MAX:"%6.2lf "',
  78. 'GPRINT:d5:LAST:"%6.2lf \n"',
  79. 'LINE1:d6#000666:"d6 "',
  80. 'GPRINT:d6:MIN:" %6.2lf "',
  81. 'GPRINT:d6:AVERAGE:"%6.2lf "',
  82. 'GPRINT:d6:MAX:"%6.2lf "',
  83. 'GPRINT:d6:LAST:"%6.2lf \n"',
  84. 'LINE1:d7#000777:"d7 "',
  85. 'GPRINT:d7:MIN:" %6.2lf "',
  86. 'GPRINT:d7:AVERAGE:"%6.2lf "',
  87. 'GPRINT:d7:MAX:"%6.2lf "',
  88. 'GPRINT:d7:LAST:"%6.2lf \n"',
  89. 'LINE1:d8#000888:"d8 "',
  90. 'GPRINT:d8:MIN:" %6.2lf "',
  91. 'GPRINT:d8:AVERAGE:"%6.2lf "',
  92. 'GPRINT:d8:MAX:"%6.2lf "',
  93. 'GPRINT:d8:LAST:"%6.2lf \n"',
  94. 'LINE1:d9#000999:"d9 "',
  95. 'GPRINT:d9:MIN:" %6.2lf "',
  96. 'GPRINT:d9:AVERAGE:"%6.2lf "',
  97. 'GPRINT:d9:MAX:"%6.2lf "',
  98. 'GPRINT:d9:LAST:"%6.2lf \n"',
  99. 'LINE1:d10#111999:"d10 "',
  100. 'GPRINT:d10:MIN:" %6.2lf "',
  101. 'GPRINT:d10:AVERAGE:"%6.2lf "',
  102. 'GPRINT:d10:MAX:"%6.2lf "',
  103. 'GPRINT:d10:LAST:"%6.2lf \n"',
  104. 'LINE1:d11#222999:"d11 "',
  105. 'GPRINT:d11:MIN:" %6.2lf "',
  106. 'GPRINT:d11:AVERAGE:"%6.2lf "',
  107. 'GPRINT:d11:MAX:"%6.2lf "',
  108. 'GPRINT:d11:LAST:"%6.2lf \n"',
  109. 'LINE1:d12#333999:"d12 "',
  110. 'GPRINT:d12:MIN:" %6.2lf "',
  111. 'GPRINT:d12:AVERAGE:"%6.2lf "',
  112. 'GPRINT:d12:MAX:"%6.2lf "',
  113. 'GPRINT:d12:LAST:"%6.2lf \n"',
  114. 'LINE1:d13#444999:"d13 "',
  115. 'GPRINT:d13:MIN:" %6.2lf "',
  116. 'GPRINT:d13:AVERAGE:"%6.2lf "',
  117. 'GPRINT:d13:MAX:"%6.2lf "',
  118. 'GPRINT:d13:LAST:"%6.2lf \n"',
  119. 'LINE1:d14#555999:"d14 "',
  120. 'GPRINT:d14:MIN:" %6.2lf "',
  121. 'GPRINT:d14:AVERAGE:"%6.2lf "',
  122. 'GPRINT:d14:MAX:"%6.2lf "',
  123. 'GPRINT:d14:LAST:"%6.2lf \n"',
  124. 'LINE1:d15#666999:"d15 "',
  125. 'GPRINT:d15:MIN:" %6.2lf "',
  126. 'GPRINT:d15:AVERAGE:"%6.2lf "',
  127. 'GPRINT:d15:MAX:"%6.2lf "',
  128. 'GPRINT:d15:LAST:"%6.2lf \n"',
  129. 'LINE1:d16#777999:"d16 "',
  130. 'GPRINT:d16:MIN:" %6.2lf "',
  131. 'GPRINT:d16:AVERAGE:"%6.2lf "',
  132. 'GPRINT:d16:MAX:"%6.2lf "',
  133. 'GPRINT:d16:LAST:"%6.2lf \n"',
  134. 'LINE1:d17#888999:"d17 "',
  135. 'GPRINT:d17:MIN:" %6.2lf "',
  136. 'GPRINT:d17:AVERAGE:"%6.2lf "',
  137. 'GPRINT:d17:MAX:"%6.2lf "',
  138. 'GPRINT:d17:LAST:"%6.2lf \n"',
  139. 'LINE1:d18#999999:"d18 "',
  140. 'GPRINT:d18:MIN:" %6.2lf "',
  141. 'GPRINT:d18:AVERAGE:"%6.2lf "',
  142. 'GPRINT:d18:MAX:"%6.2lf "',
  143. 'GPRINT:d18:LAST:"%6.2lf \n"',
  144. 'LINE1:d19#aaa999:"d19 "',
  145. 'GPRINT:d19:MIN:" %6.2lf "',
  146. 'GPRINT:d19:AVERAGE:"%6.2lf "',
  147. 'GPRINT:d19:MAX:"%6.2lf "',
  148. 'GPRINT:d19:LAST:"%6.2lf \n"' )))));
  149. $this->graphdefaults = array_merge($this->graphdefaults,
  150. $this->shortcut["debug"]["brief"]);
  151. $this->graphsettings["rawcmdline"] .=" -v 'debug'";
  152. $this->url2options($url);
  153. }
  154. }
  155. ?>