class_io.inc 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. require_once("class_graph.inc");
  3. class IO_Graph extends Graph {
  4. function IO_Graph() {
  5. // get all the sensible defaults from our parent class
  6. $this->init();
  7. }
  8. function execute($url) {
  9. $this->url2options($url);
  10. // and add a few private things
  11. $this->graphsettings["rawcmdline"] .=" -v '".$this->get("name")."'";
  12. $this->shortcut = array_merge($this->shortcut, array(
  13. "io" => array(
  14. "brief" => array(
  15. "dsdefinition" => array(
  16. "DEF:A=".$this->get("rrdfile").":bytes:AVERAGE "),
  17. "graphdefinition" => array(
  18. 'COMMENT:" min avg max last\n"',
  19. "AREA:A#00FF00:'bytes'",
  20. "GPRINT:A:MIN:'%6.2lf %sBps'",
  21. "GPRINT:A:AVERAGE:'%6.2lf %sBps'",
  22. "GPRINT:A:MAX:'%6.2lf %sBps'",
  23. "GPRINT:A:LAST:'%6.2lf %sBps'")),
  24. "all" => array(
  25. "dsdefinition" => array(
  26. "DEF:A=".$this->get("rrdfile").":transfers:AVERAGE ",
  27. "DEF:B=".$this->get("rrdfile").":seeks:AVERAGE ",
  28. "DEF:C=".$this->get("rrdfile").":bytes:AVERAGE "),
  29. "graphdefinition" => array(
  30. 'COMMENT:" min avg max last\n"',
  31. "AREA:C#00FF00:'bytes '",
  32. "GPRINT:C:MIN:'%4.2lf %sBps'",
  33. "GPRINT:C:AVERAGE:'%4.2lf %sBps'",
  34. "GPRINT:C:MAX:'%4.2lf %sBps'",
  35. 'GPRINT:C:LAST:"%4.2lf %sBps\n"',
  36. "LINE1:B#0000FF:'seeks '",
  37. "GPRINT:B:MIN:'%4.2lf '",
  38. "GPRINT:B:AVERAGE:'%4.2lf '",
  39. "GPRINT:B:MAX:'%4.2lf '",
  40. 'GPRINT:B:LAST:"%4.2lf\n"',
  41. "LINE1:A#FF0000:'transfers'",
  42. "GPRINT:A:MIN:'%4.2lf '",
  43. "GPRINT:A:AVERAGE:'%4.2lf '",
  44. "GPRINT:A:MAX:'%4.2lf '",
  45. "GPRINT:A:LAST:'%4.2lf'")))));
  46. $this->graphdefaults = array_merge($this->graphdefaults,
  47. $this->shortcut["io"]["brief"]);
  48. $this->url2options($url);
  49. }
  50. }
  51. ?>