class_io.inc 1.8 KB

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