Variables.php 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * functions for displaying server status variables
  5. *
  6. * @usedby server_status_variables.php
  7. *
  8. * @package PhpMyAdmin
  9. */
  10. namespace PhpMyAdmin\Server\Status;
  11. use PhpMyAdmin\Server\Status\Data;
  12. use PhpMyAdmin\Url;
  13. use PhpMyAdmin\Util;
  14. /**
  15. * PhpMyAdmin\Server\Status\Variables class
  16. *
  17. * @package PhpMyAdmin
  18. */
  19. class Variables
  20. {
  21. /**
  22. * Returns the html for the list filter
  23. *
  24. * @param Data $serverStatusData Server status data
  25. *
  26. * @return string
  27. */
  28. public static function getHtmlForFilter(Data $serverStatusData)
  29. {
  30. $filterAlert = '';
  31. if (! empty($_POST['filterAlert'])) {
  32. $filterAlert = ' checked="checked"';
  33. }
  34. $filterText = '';
  35. if (! empty($_POST['filterText'])) {
  36. $filterText = htmlspecialchars($_POST['filterText']);
  37. }
  38. $dontFormat = '';
  39. if (! empty($_POST['dontFormat'])) {
  40. $dontFormat = ' checked="checked"';
  41. }
  42. $retval = '';
  43. $retval .= '<fieldset id="tableFilter">';
  44. $retval .= '<legend>' . __('Filters') . '</legend>';
  45. $retval .= '<form action="server_status_variables.php" method="post">';
  46. $retval .= Url::getHiddenInputs();
  47. $retval .= '<input type="submit" value="' . __('Refresh') . '" />';
  48. $retval .= '<div class="formelement">';
  49. $retval .= '<label for="filterText">' . __('Containing the word:') . '</label>';
  50. $retval .= '<input name="filterText" type="text" id="filterText" '
  51. . 'value="' . $filterText . '" />';
  52. $retval .= '</div>';
  53. $retval .= '<div class="formelement">';
  54. $retval .= '<input' . $filterAlert . ' type="checkbox" '
  55. . 'name="filterAlert" id="filterAlert" />';
  56. $retval .= '<label for="filterAlert">';
  57. $retval .= __('Show only alert values');
  58. $retval .= '</label>';
  59. $retval .= '</div>';
  60. $retval .= '<div class="formelement">';
  61. $retval .= '<select id="filterCategory" name="filterCategory">';
  62. $retval .= '<option value="">' . __('Filter by category…') . '</option>';
  63. foreach ($serverStatusData->sections as $section_id => $section_name) {
  64. if (isset($serverStatusData->sectionUsed[$section_id])) {
  65. if (! empty($_POST['filterCategory'])
  66. && $_POST['filterCategory'] == $section_id
  67. ) {
  68. $selected = ' selected="selected"';
  69. } else {
  70. $selected = '';
  71. }
  72. $retval .= '<option' . $selected . ' value="' . $section_id . '">';
  73. $retval .= htmlspecialchars($section_name) . '</option>';
  74. }
  75. }
  76. $retval .= '</select>';
  77. $retval .= '</div>';
  78. $retval .= '<div class="formelement">';
  79. $retval .= '<input' . $dontFormat . ' type="checkbox" '
  80. . 'name="dontFormat" id="dontFormat" />';
  81. $retval .= '<label for="dontFormat">';
  82. $retval .= __('Show unformatted values');
  83. $retval .= '</label>';
  84. $retval .= '</div>';
  85. $retval .= '</form>';
  86. $retval .= '</fieldset>';
  87. return $retval;
  88. }
  89. /**
  90. * Prints the suggestion links
  91. *
  92. * @param Data $serverStatusData Server status data
  93. *
  94. * @return string
  95. */
  96. public static function getHtmlForLinkSuggestions(Data $serverStatusData)
  97. {
  98. $retval = '<div id="linkSuggestions" class="defaultLinks hide">';
  99. $retval .= '<p class="notice">' . __('Related links:');
  100. foreach ($serverStatusData->links as $section_name => $section_links) {
  101. $retval .= '<span class="status_' . $section_name . '"> ';
  102. $i = 0;
  103. foreach ($section_links as $link_name => $link_url) {
  104. if ($i > 0) {
  105. $retval .= ', ';
  106. }
  107. if ('doc' == $link_name) {
  108. $retval .= Util::showMySQLDocu($link_url);
  109. } else {
  110. $retval .= '<a href="' . $link_url['url'] . '" data-post="' . $link_url['params'] . '">'
  111. . $link_name . '</a>';
  112. }
  113. $i++;
  114. }
  115. $retval .= '</span>';
  116. }
  117. unset($link_url, $link_name, $i);
  118. $retval .= '</p>';
  119. $retval .= '</div>';
  120. return $retval;
  121. }
  122. /**
  123. * Returns a table with variables information
  124. *
  125. * @param Data $serverStatusData Server status data
  126. *
  127. * @return string
  128. */
  129. public static function getHtmlForVariablesList(Data $serverStatusData)
  130. {
  131. $retval = '';
  132. $strShowStatus = self::getDescriptions();
  133. /**
  134. * define some alerts
  135. */
  136. // name => max value before alert
  137. $alerts = array(
  138. // lower is better
  139. // variable => max value
  140. 'Aborted_clients' => 0,
  141. 'Aborted_connects' => 0,
  142. 'Binlog_cache_disk_use' => 0,
  143. 'Created_tmp_disk_tables' => 0,
  144. 'Handler_read_rnd' => 0,
  145. 'Handler_read_rnd_next' => 0,
  146. 'Innodb_buffer_pool_pages_dirty' => 0,
  147. 'Innodb_buffer_pool_reads' => 0,
  148. 'Innodb_buffer_pool_wait_free' => 0,
  149. 'Innodb_log_waits' => 0,
  150. 'Innodb_row_lock_time_avg' => 10, // ms
  151. 'Innodb_row_lock_time_max' => 50, // ms
  152. 'Innodb_row_lock_waits' => 0,
  153. 'Slow_queries' => 0,
  154. 'Delayed_errors' => 0,
  155. 'Select_full_join' => 0,
  156. 'Select_range_check' => 0,
  157. 'Sort_merge_passes' => 0,
  158. 'Opened_tables' => 0,
  159. 'Table_locks_waited' => 0,
  160. 'Qcache_lowmem_prunes' => 0,
  161. 'Qcache_free_blocks' =>
  162. isset($serverStatusData->status['Qcache_total_blocks'])
  163. ? $serverStatusData->status['Qcache_total_blocks'] / 5
  164. : 0,
  165. 'Slow_launch_threads' => 0,
  166. // depends on Key_read_requests
  167. // normally lower then 1:0.01
  168. 'Key_reads' => isset($serverStatusData->status['Key_read_requests'])
  169. ? (0.01 * $serverStatusData->status['Key_read_requests']) : 0,
  170. // depends on Key_write_requests
  171. // normally nearly 1:1
  172. 'Key_writes' => isset($serverStatusData->status['Key_write_requests'])
  173. ? (0.9 * $serverStatusData->status['Key_write_requests']) : 0,
  174. 'Key_buffer_fraction' => 0.5,
  175. // alert if more than 95% of thread cache is in use
  176. 'Threads_cached' => isset($serverStatusData->variables['thread_cache_size'])
  177. ? 0.95 * $serverStatusData->variables['thread_cache_size'] : 0
  178. // higher is better
  179. // variable => min value
  180. //'Handler read key' => '> ',
  181. );
  182. $retval .= self::getHtmlForRenderVariables(
  183. $serverStatusData,
  184. $alerts,
  185. $strShowStatus
  186. );
  187. return $retval;
  188. }
  189. /**
  190. * Returns HTML for render variables list
  191. *
  192. * @param Data $serverStatusData Server status data
  193. * @param array $alerts Alert Array
  194. * @param array $strShowStatus Status Array
  195. *
  196. * @return string
  197. */
  198. public static function getHtmlForRenderVariables(Data $serverStatusData, array $alerts, array $strShowStatus)
  199. {
  200. $retval = '<div class="responsivetable">';
  201. $retval .= '<table class="data noclick" id="serverstatusvariables">';
  202. $retval .= '<col class="namecol" />';
  203. $retval .= '<col class="valuecol" />';
  204. $retval .= '<col class="descrcol" />';
  205. $retval .= '<thead>';
  206. $retval .= '<tr>';
  207. $retval .= '<th>' . __('Variable') . '</th>';
  208. $retval .= '<th>' . __('Value') . '</th>';
  209. $retval .= '<th>' . __('Description') . '</th>';
  210. $retval .= '</tr>';
  211. $retval .= '</thead>';
  212. $retval .= '<tbody>';
  213. foreach ($serverStatusData->status as $name => $value) {
  214. $retval .= '<tr class="' . (isset($serverStatusData->allocationMap[$name])
  215. ?' s_' . $serverStatusData->allocationMap[$name]
  216. : '')
  217. . '">';
  218. $retval .= '<th class="name">';
  219. $retval .= htmlspecialchars(str_replace('_', ' ', $name));
  220. // Fields containing % are calculated,
  221. // they can not be described in MySQL documentation
  222. if (mb_strpos($name, '%') === false) {
  223. $retval .= Util::showMySQLDocu(
  224. 'server-status-variables',
  225. false,
  226. 'statvar_' . $name
  227. );
  228. }
  229. $retval .= '</th>';
  230. $retval .= '<td class="value"><span class="formatted">';
  231. if (isset($alerts[$name])) {
  232. if ($value > $alerts[$name]) {
  233. $retval .= '<span class="attention">';
  234. } else {
  235. $retval .= '<span class="allfine">';
  236. }
  237. }
  238. if (substr($name, -1) === '%') {
  239. $retval .= htmlspecialchars(
  240. Util::formatNumber($value, 0, 2)
  241. ) . ' %';
  242. } elseif (strpos($name, 'Uptime') !== false) {
  243. $retval .= htmlspecialchars(
  244. Util::timespanFormat($value)
  245. );
  246. } elseif (is_numeric($value) && $value > 1000) {
  247. $retval .= '<abbr title="'
  248. // makes available the raw value as a title
  249. . htmlspecialchars(Util::formatNumber($value, 0))
  250. . '">'
  251. . htmlspecialchars(Util::formatNumber($value, 3, 1))
  252. . '</abbr>';
  253. } elseif (is_numeric($value)) {
  254. $retval .= htmlspecialchars(
  255. Util::formatNumber($value, 3, 1)
  256. );
  257. } else {
  258. $retval .= htmlspecialchars($value);
  259. }
  260. if (isset($alerts[$name])) {
  261. $retval .= '</span>';
  262. }
  263. $retval .= '</span>';
  264. $retval .= '<span class="original hide">';
  265. if (isset($alerts[$name])) {
  266. if ($value > $alerts[$name]) {
  267. $retval .= '<span class="attention">';
  268. } else {
  269. $retval .= '<span class="allfine">';
  270. }
  271. }
  272. $retval .= htmlspecialchars($value);
  273. if (isset($alerts[$name])) {
  274. $retval .= '</span>';
  275. }
  276. $retval .= '</span>';
  277. $retval .= '</td>';
  278. $retval .= '<td class="descr">';
  279. if (isset($strShowStatus[$name])) {
  280. $retval .= $strShowStatus[$name];
  281. }
  282. if (isset($serverStatusData->links[$name])) {
  283. foreach ($serverStatusData->links[$name] as $link_name => $link_url) {
  284. if ('doc' == $link_name) {
  285. $retval .= Util::showMySQLDocu($link_url);
  286. } else {
  287. $retval .= ' <a href="' . $link_url['url'] . '" data-post="' . $link_url['params'] . '">'
  288. . $link_name . '</a>';
  289. }
  290. }
  291. unset($link_url, $link_name);
  292. }
  293. $retval .= '</td>';
  294. $retval .= '</tr>';
  295. }
  296. $retval .= '</tbody>';
  297. $retval .= '</table>';
  298. $retval .= '</div>';
  299. return $retval;
  300. }
  301. /**
  302. * Returns a list of variable descriptions
  303. *
  304. * @return array
  305. */
  306. public static function getDescriptions()
  307. {
  308. /**
  309. * Messages are built using the message name
  310. */
  311. return array(
  312. 'Aborted_clients' => __(
  313. 'The number of connections that were aborted because the client died'
  314. . ' without closing the connection properly.'
  315. ),
  316. 'Aborted_connects' => __(
  317. 'The number of failed attempts to connect to the MySQL server.'
  318. ),
  319. 'Binlog_cache_disk_use' => __(
  320. 'The number of transactions that used the temporary binary log cache'
  321. . ' but that exceeded the value of binlog_cache_size and used a'
  322. . ' temporary file to store statements from the transaction.'
  323. ),
  324. 'Binlog_cache_use' => __(
  325. 'The number of transactions that used the temporary binary log cache.'
  326. ),
  327. 'Connections' => __(
  328. 'The number of connection attempts (successful or not)'
  329. . ' to the MySQL server.'
  330. ),
  331. 'Created_tmp_disk_tables' => __(
  332. 'The number of temporary tables on disk created automatically by'
  333. . ' the server while executing statements. If'
  334. . ' Created_tmp_disk_tables is big, you may want to increase the'
  335. . ' tmp_table_size value to cause temporary tables to be'
  336. . ' memory-based instead of disk-based.'
  337. ),
  338. 'Created_tmp_files' => __(
  339. 'How many temporary files mysqld has created.'
  340. ),
  341. 'Created_tmp_tables' => __(
  342. 'The number of in-memory temporary tables created automatically'
  343. . ' by the server while executing statements.'
  344. ),
  345. 'Delayed_errors' => __(
  346. 'The number of rows written with INSERT DELAYED for which some'
  347. . ' error occurred (probably duplicate key).'
  348. ),
  349. 'Delayed_insert_threads' => __(
  350. 'The number of INSERT DELAYED handler threads in use. Every'
  351. . ' different table on which one uses INSERT DELAYED gets'
  352. . ' its own thread.'
  353. ),
  354. 'Delayed_writes' => __(
  355. 'The number of INSERT DELAYED rows written.'
  356. ),
  357. 'Flush_commands' => __(
  358. 'The number of executed FLUSH statements.'
  359. ),
  360. 'Handler_commit' => __(
  361. 'The number of internal COMMIT statements.'
  362. ),
  363. 'Handler_delete' => __(
  364. 'The number of times a row was deleted from a table.'
  365. ),
  366. 'Handler_discover' => __(
  367. 'The MySQL server can ask the NDB Cluster storage engine if it'
  368. . ' knows about a table with a given name. This is called discovery.'
  369. . ' Handler_discover indicates the number of time tables have been'
  370. . ' discovered.'
  371. ),
  372. 'Handler_read_first' => __(
  373. 'The number of times the first entry was read from an index. If this'
  374. . ' is high, it suggests that the server is doing a lot of full'
  375. . ' index scans; for example, SELECT col1 FROM foo, assuming that'
  376. . ' col1 is indexed.'
  377. ),
  378. 'Handler_read_key' => __(
  379. 'The number of requests to read a row based on a key. If this is'
  380. . ' high, it is a good indication that your queries and tables'
  381. . ' are properly indexed.'
  382. ),
  383. 'Handler_read_next' => __(
  384. 'The number of requests to read the next row in key order. This is'
  385. . ' incremented if you are querying an index column with a range'
  386. . ' constraint or if you are doing an index scan.'
  387. ),
  388. 'Handler_read_prev' => __(
  389. 'The number of requests to read the previous row in key order.'
  390. . ' This read method is mainly used to optimize ORDER BY … DESC.'
  391. ),
  392. 'Handler_read_rnd' => __(
  393. 'The number of requests to read a row based on a fixed position.'
  394. . ' This is high if you are doing a lot of queries that require'
  395. . ' sorting of the result. You probably have a lot of queries that'
  396. . ' require MySQL to scan whole tables or you have joins that'
  397. . ' don\'t use keys properly.'
  398. ),
  399. 'Handler_read_rnd_next' => __(
  400. 'The number of requests to read the next row in the data file.'
  401. . ' This is high if you are doing a lot of table scans. Generally'
  402. . ' this suggests that your tables are not properly indexed or that'
  403. . ' your queries are not written to take advantage of the indexes'
  404. . ' you have.'
  405. ),
  406. 'Handler_rollback' => __(
  407. 'The number of internal ROLLBACK statements.'
  408. ),
  409. 'Handler_update' => __(
  410. 'The number of requests to update a row in a table.'
  411. ),
  412. 'Handler_write' => __(
  413. 'The number of requests to insert a row in a table.'
  414. ),
  415. 'Innodb_buffer_pool_pages_data' => __(
  416. 'The number of pages containing data (dirty or clean).'
  417. ),
  418. 'Innodb_buffer_pool_pages_dirty' => __(
  419. 'The number of pages currently dirty.'
  420. ),
  421. 'Innodb_buffer_pool_pages_flushed' => __(
  422. 'The number of buffer pool pages that have been requested'
  423. . ' to be flushed.'
  424. ),
  425. 'Innodb_buffer_pool_pages_free' => __(
  426. 'The number of free pages.'
  427. ),
  428. 'Innodb_buffer_pool_pages_latched' => __(
  429. 'The number of latched pages in InnoDB buffer pool. These are pages'
  430. . ' currently being read or written or that can\'t be flushed or'
  431. . ' removed for some other reason.'
  432. ),
  433. 'Innodb_buffer_pool_pages_misc' => __(
  434. 'The number of pages busy because they have been allocated for'
  435. . ' administrative overhead such as row locks or the adaptive'
  436. . ' hash index. This value can also be calculated as'
  437. . ' Innodb_buffer_pool_pages_total - Innodb_buffer_pool_pages_free'
  438. . ' - Innodb_buffer_pool_pages_data.'
  439. ),
  440. 'Innodb_buffer_pool_pages_total' => __(
  441. 'Total size of buffer pool, in pages.'
  442. ),
  443. 'Innodb_buffer_pool_read_ahead_rnd' => __(
  444. 'The number of "random" read-aheads InnoDB initiated. This happens'
  445. . ' when a query is to scan a large portion of a table but in'
  446. . ' random order.'
  447. ),
  448. 'Innodb_buffer_pool_read_ahead_seq' => __(
  449. 'The number of sequential read-aheads InnoDB initiated. This'
  450. . ' happens when InnoDB does a sequential full table scan.'
  451. ),
  452. 'Innodb_buffer_pool_read_requests' => __(
  453. 'The number of logical read requests InnoDB has done.'
  454. ),
  455. 'Innodb_buffer_pool_reads' => __(
  456. 'The number of logical reads that InnoDB could not satisfy'
  457. . ' from buffer pool and had to do a single-page read.'
  458. ),
  459. 'Innodb_buffer_pool_wait_free' => __(
  460. 'Normally, writes to the InnoDB buffer pool happen in the'
  461. . ' background. However, if it\'s necessary to read or create a page'
  462. . ' and no clean pages are available, it\'s necessary to wait for'
  463. . ' pages to be flushed first. This counter counts instances of'
  464. . ' these waits. If the buffer pool size was set properly, this'
  465. . ' value should be small.'
  466. ),
  467. 'Innodb_buffer_pool_write_requests' => __(
  468. 'The number writes done to the InnoDB buffer pool.'
  469. ),
  470. 'Innodb_data_fsyncs' => __(
  471. 'The number of fsync() operations so far.'
  472. ),
  473. 'Innodb_data_pending_fsyncs' => __(
  474. 'The current number of pending fsync() operations.'
  475. ),
  476. 'Innodb_data_pending_reads' => __(
  477. 'The current number of pending reads.'
  478. ),
  479. 'Innodb_data_pending_writes' => __(
  480. 'The current number of pending writes.'
  481. ),
  482. 'Innodb_data_read' => __(
  483. 'The amount of data read so far, in bytes.'
  484. ),
  485. 'Innodb_data_reads' => __(
  486. 'The total number of data reads.'
  487. ),
  488. 'Innodb_data_writes' => __(
  489. 'The total number of data writes.'
  490. ),
  491. 'Innodb_data_written' => __(
  492. 'The amount of data written so far, in bytes.'
  493. ),
  494. 'Innodb_dblwr_pages_written' => __(
  495. 'The number of pages that have been written for'
  496. . ' doublewrite operations.'
  497. ),
  498. 'Innodb_dblwr_writes' => __(
  499. 'The number of doublewrite operations that have been performed.'
  500. ),
  501. 'Innodb_log_waits' => __(
  502. 'The number of waits we had because log buffer was too small and'
  503. . ' we had to wait for it to be flushed before continuing.'
  504. ),
  505. 'Innodb_log_write_requests' => __(
  506. 'The number of log write requests.'
  507. ),
  508. 'Innodb_log_writes' => __(
  509. 'The number of physical writes to the log file.'
  510. ),
  511. 'Innodb_os_log_fsyncs' => __(
  512. 'The number of fsync() writes done to the log file.'
  513. ),
  514. 'Innodb_os_log_pending_fsyncs' => __(
  515. 'The number of pending log file fsyncs.'
  516. ),
  517. 'Innodb_os_log_pending_writes' => __(
  518. 'Pending log file writes.'
  519. ),
  520. 'Innodb_os_log_written' => __(
  521. 'The number of bytes written to the log file.'
  522. ),
  523. 'Innodb_pages_created' => __(
  524. 'The number of pages created.'
  525. ),
  526. 'Innodb_page_size' => __(
  527. 'The compiled-in InnoDB page size (default 16KB). Many values are'
  528. . ' counted in pages; the page size allows them to be easily'
  529. . ' converted to bytes.'
  530. ),
  531. 'Innodb_pages_read' => __(
  532. 'The number of pages read.'
  533. ),
  534. 'Innodb_pages_written' => __(
  535. 'The number of pages written.'
  536. ),
  537. 'Innodb_row_lock_current_waits' => __(
  538. 'The number of row locks currently being waited for.'
  539. ),
  540. 'Innodb_row_lock_time_avg' => __(
  541. 'The average time to acquire a row lock, in milliseconds.'
  542. ),
  543. 'Innodb_row_lock_time' => __(
  544. 'The total time spent in acquiring row locks, in milliseconds.'
  545. ),
  546. 'Innodb_row_lock_time_max' => __(
  547. 'The maximum time to acquire a row lock, in milliseconds.'
  548. ),
  549. 'Innodb_row_lock_waits' => __(
  550. 'The number of times a row lock had to be waited for.'
  551. ),
  552. 'Innodb_rows_deleted' => __(
  553. 'The number of rows deleted from InnoDB tables.'
  554. ),
  555. 'Innodb_rows_inserted' => __(
  556. 'The number of rows inserted in InnoDB tables.'
  557. ),
  558. 'Innodb_rows_read' => __(
  559. 'The number of rows read from InnoDB tables.'
  560. ),
  561. 'Innodb_rows_updated' => __(
  562. 'The number of rows updated in InnoDB tables.'
  563. ),
  564. 'Key_blocks_not_flushed' => __(
  565. 'The number of key blocks in the key cache that have changed but'
  566. . ' haven\'t yet been flushed to disk. It used to be known as'
  567. . ' Not_flushed_key_blocks.'
  568. ),
  569. 'Key_blocks_unused' => __(
  570. 'The number of unused blocks in the key cache. You can use this'
  571. . ' value to determine how much of the key cache is in use.'
  572. ),
  573. 'Key_blocks_used' => __(
  574. 'The number of used blocks in the key cache. This value is a'
  575. . ' high-water mark that indicates the maximum number of blocks'
  576. . ' that have ever been in use at one time.'
  577. ),
  578. 'Key_buffer_fraction_%' => __(
  579. 'Percentage of used key cache (calculated value)'
  580. ),
  581. 'Key_read_requests' => __(
  582. 'The number of requests to read a key block from the cache.'
  583. ),
  584. 'Key_reads' => __(
  585. 'The number of physical reads of a key block from disk. If Key_reads'
  586. . ' is big, then your key_buffer_size value is probably too small.'
  587. . ' The cache miss rate can be calculated as'
  588. . ' Key_reads/Key_read_requests.'
  589. ),
  590. 'Key_read_ratio_%' => __(
  591. 'Key cache miss calculated as rate of physical reads compared'
  592. . ' to read requests (calculated value)'
  593. ),
  594. 'Key_write_requests' => __(
  595. 'The number of requests to write a key block to the cache.'
  596. ),
  597. 'Key_writes' => __(
  598. 'The number of physical writes of a key block to disk.'
  599. ),
  600. 'Key_write_ratio_%' => __(
  601. 'Percentage of physical writes compared'
  602. . ' to write requests (calculated value)'
  603. ),
  604. 'Last_query_cost' => __(
  605. 'The total cost of the last compiled query as computed by the query'
  606. . ' optimizer. Useful for comparing the cost of different query'
  607. . ' plans for the same query. The default value of 0 means that'
  608. . ' no query has been compiled yet.'
  609. ),
  610. 'Max_used_connections' => __(
  611. 'The maximum number of connections that have been in use'
  612. . ' simultaneously since the server started.'
  613. ),
  614. 'Not_flushed_delayed_rows' => __(
  615. 'The number of rows waiting to be written in INSERT DELAYED queues.'
  616. ),
  617. 'Opened_tables' => __(
  618. 'The number of tables that have been opened. If opened tables is'
  619. . ' big, your table cache value is probably too small.'
  620. ),
  621. 'Open_files' => __(
  622. 'The number of files that are open.'
  623. ),
  624. 'Open_streams' => __(
  625. 'The number of streams that are open (used mainly for logging).'
  626. ),
  627. 'Open_tables' => __(
  628. 'The number of tables that are open.'
  629. ),
  630. 'Qcache_free_blocks' => __(
  631. 'The number of free memory blocks in query cache. High numbers can'
  632. . ' indicate fragmentation issues, which may be solved by issuing'
  633. . ' a FLUSH QUERY CACHE statement.'
  634. ),
  635. 'Qcache_free_memory' => __(
  636. 'The amount of free memory for query cache.'
  637. ),
  638. 'Qcache_hits' => __(
  639. 'The number of cache hits.'
  640. ),
  641. 'Qcache_inserts' => __(
  642. 'The number of queries added to the cache.'
  643. ),
  644. 'Qcache_lowmem_prunes' => __(
  645. 'The number of queries that have been removed from the cache to'
  646. . ' free up memory for caching new queries. This information can'
  647. . ' help you tune the query cache size. The query cache uses a'
  648. . ' least recently used (LRU) strategy to decide which queries'
  649. . ' to remove from the cache.'
  650. ),
  651. 'Qcache_not_cached' => __(
  652. 'The number of non-cached queries (not cachable, or not cached'
  653. . ' due to the query_cache_type setting).'
  654. ),
  655. 'Qcache_queries_in_cache' => __(
  656. 'The number of queries registered in the cache.'
  657. ),
  658. 'Qcache_total_blocks' => __(
  659. 'The total number of blocks in the query cache.'
  660. ),
  661. 'Rpl_status' => __(
  662. 'The status of failsafe replication (not yet implemented).'
  663. ),
  664. 'Select_full_join' => __(
  665. 'The number of joins that do not use indexes. If this value is'
  666. . ' not 0, you should carefully check the indexes of your tables.'
  667. ),
  668. 'Select_full_range_join' => __(
  669. 'The number of joins that used a range search on a reference table.'
  670. ),
  671. 'Select_range_check' => __(
  672. 'The number of joins without keys that check for key usage after'
  673. . ' each row. (If this is not 0, you should carefully check the'
  674. . ' indexes of your tables.)'
  675. ),
  676. 'Select_range' => __(
  677. 'The number of joins that used ranges on the first table. (It\'s'
  678. . ' normally not critical even if this is big.)'
  679. ),
  680. 'Select_scan' => __(
  681. 'The number of joins that did a full scan of the first table.'
  682. ),
  683. 'Slave_open_temp_tables' => __(
  684. 'The number of temporary tables currently'
  685. . ' open by the slave SQL thread.'
  686. ),
  687. 'Slave_retried_transactions' => __(
  688. 'Total (since startup) number of times the replication slave SQL'
  689. . ' thread has retried transactions.'
  690. ),
  691. 'Slave_running' => __(
  692. 'This is ON if this server is a slave that is connected to a master.'
  693. ),
  694. 'Slow_launch_threads' => __(
  695. 'The number of threads that have taken more than slow_launch_time'
  696. . ' seconds to create.'
  697. ),
  698. 'Slow_queries' => __(
  699. 'The number of queries that have taken more than long_query_time'
  700. . ' seconds.'
  701. ),
  702. 'Sort_merge_passes' => __(
  703. 'The number of merge passes the sort algorithm has had to do.'
  704. . ' If this value is large, you should consider increasing the'
  705. . ' value of the sort_buffer_size system variable.'
  706. ),
  707. 'Sort_range' => __(
  708. 'The number of sorts that were done with ranges.'
  709. ),
  710. 'Sort_rows' => __(
  711. 'The number of sorted rows.'
  712. ),
  713. 'Sort_scan' => __(
  714. 'The number of sorts that were done by scanning the table.'
  715. ),
  716. 'Table_locks_immediate' => __(
  717. 'The number of times that a table lock was acquired immediately.'
  718. ),
  719. 'Table_locks_waited' => __(
  720. 'The number of times that a table lock could not be acquired'
  721. . ' immediately and a wait was needed. If this is high, and you have'
  722. . ' performance problems, you should first optimize your queries,'
  723. . ' and then either split your table or tables or use replication.'
  724. ),
  725. 'Threads_cached' => __(
  726. 'The number of threads in the thread cache. The cache hit rate can'
  727. . ' be calculated as Threads_created/Connections. If this value is'
  728. . ' red you should raise your thread_cache_size.'
  729. ),
  730. 'Threads_connected' => __(
  731. 'The number of currently open connections.'
  732. ),
  733. 'Threads_created' => __(
  734. 'The number of threads created to handle connections. If'
  735. . ' Threads_created is big, you may want to increase the'
  736. . ' thread_cache_size value. (Normally this doesn\'t give a notable'
  737. . ' performance improvement if you have a good thread'
  738. . ' implementation.)'
  739. ),
  740. 'Threads_cache_hitrate_%' => __(
  741. 'Thread cache hit rate (calculated value)'
  742. ),
  743. 'Threads_running' => __(
  744. 'The number of threads that are not sleeping.'
  745. )
  746. );
  747. }
  748. }