1 | <?php |
||
7 | class StatusCommand extends AbstractShowCommand |
||
8 | { |
||
9 | protected $showMethod = 'getGlobalStatus'; |
||
10 | |||
11 | /** |
||
12 | * Add more important status variables |
||
13 | * |
||
14 | * @var array |
||
15 | */ |
||
16 | protected $_importantVars = array( |
||
17 | 'Threads_connected' => array( |
||
18 | 'desc' => 'Total number of clients that have currently open connections to the server.', |
||
19 | ), |
||
20 | 'Created_tmp_disk_tables' => array( |
||
21 | 'desc' => 'Number of temporary tables that have been created on disk instead of in-memory. Lower is |
||
22 | better.', |
||
23 | ), |
||
24 | 'Handler_read_first' => array( |
||
25 | 'desc' => 'Number of times a table handler made a request to read the first row of a table index.', |
||
26 | ), |
||
27 | 'Handler_read_rnd_next' => array( |
||
28 | 'desc' => 'Number of requests to read the next row in the data file. This value is high if you |
||
29 | are doing a lot of table scans. Generally this suggests that your tables are not properly indexed or |
||
30 | that your queries are not written to take advantage of the indexes you have.', |
||
31 | ), |
||
32 | 'Innodb_buffer_pool_wait_free' => array( |
||
33 | 'desc' => 'Number of times MySQL has to wait for memory pages to be flushed.', |
||
34 | ), |
||
35 | 'Innodb_buffer_pool_pages_dirty' => array( |
||
36 | 'desc' => 'Indicates the number of InnoDB buffer pool data pages that have been changed in memory, |
||
37 | but the changes are not yet written (flushed) to the InnoDB data files', |
||
38 | ), |
||
39 | 'Key_reads' => array( |
||
40 | 'desc' => 'Number of filesystem accesses MySQL performed to fetch database indexes.', |
||
41 | ), |
||
42 | 'Max_used_connections' => array( |
||
43 | 'desc' => 'Max number of connections MySQL has had open at the same time since the server |
||
44 | was last restarted.', |
||
45 | ), |
||
46 | 'Open_tables' => array( |
||
47 | 'desc' => 'Number of tables that are currently open.', |
||
48 | ), |
||
49 | 'Select_full_join' => array( |
||
50 | 'desc' => 'Number of full joins MySQL has performed to satisfy client queries.', |
||
51 | ), |
||
52 | 'Slow_queries' => array( |
||
53 | 'desc' => 'Number of queries that have taken longer than usual to execute.', |
||
54 | ), |
||
55 | 'Uptime' => array( |
||
56 | 'desc' => 'Time since the server was last restarted.', |
||
57 | ), |
||
58 | 'Aborted_connects' => array( |
||
59 | 'desc' => 'Total number of failed attempts to connect to MySQL.', |
||
60 | ), |
||
61 | ); |
||
62 | /** |
||
63 | * @var array |
||
64 | */ |
||
65 | protected $_specialFormat = array( |
||
66 | 'Uptime' => array('N98\Util\TimeElapsed', 'short'), |
||
67 | ); |
||
68 | |||
69 | protected function configure() |
||
81 | |||
82 | /** |
||
83 | * @param array $outputVars |
||
84 | * @param bool $hasDescription |
||
85 | * |
||
86 | * @return array |
||
87 | */ |
||
88 | protected function generateRows(array $outputVars, $hasDescription) |
||
137 | |||
138 | /** |
||
139 | * @param string $name |
||
140 | * |
||
141 | * @return bool |
||
142 | */ |
||
143 | protected function allowRounding($name) |
||
149 | |||
150 | /** |
||
151 | * borrowed from <http://stackoverflow.com/questions/1416697/> |
||
152 | * |
||
153 | * echo time_elapsed_string('2013-05-01 00:22:35'); |
||
154 | * echo time_elapsed_string('@1367367755'); # timestamp input |
||
155 | * echo time_elapsed_string('2013-05-01 00:22:35', true); |
||
156 | * |
||
157 | * @param $datetime |
||
158 | * @param bool $full |
||
159 | * @deprecated since 1.3.2, use callback "N98\Util\TimeElapsed::short" instead |
||
160 | * @see \N98\Util\TimeElapsed::short() |
||
161 | * |
||
162 | * @return string |
||
163 | */ |
||
164 | protected function timeElapsedString($datetime, $full = false) |
||
168 | } |
||
169 |