github上go语言开发的MySQL运行性能监控脚本,试了一下还不错,类似于linux top:
源代码地址:https://github.com/dblucyne/dodba_tools
运行结果如下:
[root@zttang dodba_tools]# ./doDBA -innodb; ./doDBA -mysql; ./doDBA -mytop
DoDBA tools on host 127.0.0.1
---------+------innodb--rows-----+---------innodb--pages--------+-------innodb--data-------+--innodb-log--
time | read ins upd del| data free dirty flush|reads writes read written|fsyncs written
---------+-----------------------+------------------------------+--------------------------+--------------
11:02:55 | 0 0 0 0| 1764 6380 0 0| 0 0 0K 0K| 0 0K
11:02:56 | 0 0 0 0| 1764 6380 0 0| 0 0 0K 0K| 0 0K
11:02:57 | 0 0 0 0| 1764 6380 0 0| 0 0 0K 0K| 0 0K
11:02:58 | 0 0 0 0| 1764 6380 0 0| 0 0 0K 0K| 0 0K
11:02:59 | 0 0 0 0| 1764 6380 0 0| 0 0 0K 0K| 0 0K
11:03:00 | 0 0 0 0| 1764 6380 0 0| 0 0 0K 0K| 0 0K
11:03:01 | 0 0 0 0| 1764 6380 0 0| 0 0 0K 0K| 0 0K
11:03:02 | 980 0 0 0| 1764 6380 0 0| 0 0 0K 0K| 0 0K
---------+-------mysql-status-------+-----threads-----+-----slow-----+---bytes---+---------locks----------
time | QPS TPS ins upd del| run con cre cac| sql tmp Dtmp| recv send| lockI lockW openT openF
---------+--------------------------+-----------------+--------------+-----------+------------------------
11:03:05 | 0 0 0 0 0| 2 1 0 8| 0 1 0| 0K 2K| 1 0 1304 228
11:03:06 | 0 0 0 0 0| 2 1 0 8| 0 1 0| 0K 2K| 1 0 1304 228
11:03:07 | 0 0 0 0 0| 2 1 0 8| 0 1 0| 0K 2K| 1 0 1304 228
11:03:08 | 0 0 0 0 0| 2 1 0 8| 0 1 0| 0K 2K| 1 0 1304 228
11:03:09 | 0 0 0 0 0| 2 1 0 8| 0 1 0| 0K 2K| 1 0 1304 228
11:03:10 | 0 0 0 0 0| 2 1 0 8| 0 1 0| 0K 2K| 1 0 1304 228