- 论坛徽章:
- 2
|
参考:
1. http://www.percona.com/doc/perco ... #collect-time-point
2. http://code.google.com/p/mysql-c ... uery_Response_Time_(Microseconds)
功能:
1. 统计mysql的查询时间分布
2. 统计mysql的查询时间次数分布
解释:
mysql> show variables like 'QUERY_RESPONSE%';
+--------------------------------+-------+
| Variable_name | Value |
+--------------------------------+-------+
| query_response_time_range_base | 10 |
| query_response_time_stats | ON |
+--------------------------------+-------+
1.默认情况下query_response_time_stats的值是OFF的,打开这个值,才能进行查询统计,统计情况保存在INFORMATION_SCHEMA.QUERY_RESPONSE_TIME表中.
2.query_response_time_range_base的意思是:以10为底的指数.官网的说明如下,n的值为-6
(range_base ^ n; range_base ^ (n+1)]
例子
+----------------+-------+------------+
| time | count | total |
+----------------+-------+------------|
| 0.000001 | 0 | 0.000000 |
| 0.000010 | 17 | 0.000094 |
| 0.000100 | 4301 | 0.236555 |
| 0.001000 | 1499 | 0.824450 |
| 0.010000 | 14851 | 81.680502 |
| 0.100000 | 8066 | 443.635693 |
| 1.000000 | 0 | 0.000000 |
| 10.000000 | 0 | 0.000000 |
| 100.000000 | 1 | 55.937094 |
| 1000.000000 | 0 | 0.000000 |
| 10000.000000 | 0 | 0.000000 |
| 100000.000000 | 0 | 0.000000 |
| 1000000.000000 | 0 | 0.000000 |
| TOO LONG QUERY | 0 | 0.000000 |
+----------------+-------+------------+
* 17 queries with 0.000001 < query execution time < = 0.000010 seconds; total execution time of the 17 queries = 0.000094 seconds
意思是
在1微秒和10微秒(包含10微秒)直接,有17次查询,并且,17次查询总计用时94微秒
|
|