server_status_advisor.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * displays the advisor feature
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. require_once 'libraries/common.inc.php';
  9. require_once 'libraries/Advisor.class.php';
  10. require_once 'libraries/ServerStatusData.class.php';
  11. if (PMA_DRIZZLE) {
  12. $server_master_status = false;
  13. $server_slave_status = false;
  14. } else {
  15. include_once 'libraries/replication.inc.php';
  16. include_once 'libraries/replication_gui.lib.php';
  17. }
  18. $ServerStatusData = new PMA_ServerStatusData();
  19. $response = PMA_Response::getInstance();
  20. $scripts = $response->getHeader()->getScripts();
  21. $scripts->addFile('server_status_advisor.js');
  22. $output = '<div>';
  23. $output .= $ServerStatusData->getMenuHtml();
  24. $output .= '<a href="#openAdvisorInstructions">';
  25. $output .= PMA_Util::getIcon('b_help.png', __('Instructions'));
  26. $output .= '</a>';
  27. $output .= '<div id="statustabs_advisor"></div>';
  28. $output .= '<div id="advisorInstructionsDialog" style="display:none;">';
  29. $output .= '<p>';
  30. $output .= __(
  31. 'The Advisor system can provide recommendations '
  32. . 'on server variables by analyzing the server status variables.'
  33. );
  34. $output .= '</p>';
  35. $output .= '<p>';
  36. $output .= __(
  37. 'Do note however that this system provides recommendations '
  38. . 'based on simple calculations and by rule of thumb which may '
  39. . 'not necessarily apply to your system.'
  40. );
  41. $output .= '</p>';
  42. $output .= '<p>';
  43. $output .= __(
  44. 'Prior to changing any of the configuration, be sure to know '
  45. . 'what you are changing (by reading the documentation) and how '
  46. . 'to undo the change. Wrong tuning can have a very negative '
  47. . 'effect on performance.'
  48. );
  49. $output .= '</p>';
  50. $output .= '<p>';
  51. $output .= __(
  52. 'The best way to tune your system would be to change only one '
  53. . 'setting at a time, observe or benchmark your database, and undo '
  54. . 'the change if there was no clearly measurable improvement.'
  55. );
  56. $output .= '</p>';
  57. $output .= '</div>';
  58. $output .= '<div id="advisorData" style="display:none;">';
  59. $advisor = new Advisor();
  60. $output .= htmlspecialchars(
  61. json_encode(
  62. $advisor->run()
  63. )
  64. );
  65. $output .= '</div>';
  66. $output .= '</div>';
  67. $response->addHTML($output);
  68. ?>