Home  >  Article  >  Database  >  MySQL monitoring tool mysql-monitor detailed explanation

MySQL monitoring tool mysql-monitor detailed explanation

Guanhui
Guanhuiforward
2020-07-21 12:37:393474browse


MySQL monitoring tool mysql-monitor detailed explanation

1. Overview

mysql- monitor MYSQL monitoring tools, optimization tools, and various tools integrated into the java spring boot project

git地址:https://github.com/lccbiluox2/mysql-monitor.git

2. Code structure

MySQL monitoring tool mysql-monitor detailed explanation

3. Backend service

The main class of the backend service is com.neo.MySQLMointorApplication

3.1 Backend service database

spring.datasource.driverClassName = com.mysql.jdbc.Driver
spring.datasource.url = jdbc:mysql://localhost:3306/mysql_monitor?useUnicode=true&characterEncoding=utf-8&useSSL=true
spring.datasource.username = root
spring.datasource.password = 12345678

Modify this according to your own needs.

The SQL running script is in doc/sql/mysql_monitor.sqlPlease perform the table creation operation first, and then run the main class.

4. Front-end service

Front-end main page:web-provider/html/database/database-list.html

Because the front-end and back-end are separated, the most original html jquery ajax is used to operate the back-end and display it, which solves the cross-domain problem. Just open the page directly.

4.1 Configuration

The front-end configuration file is as follows: web-provider/js/constant.js

//定义几个全局变量
var AppUrl = "http://localhost:8090";//整个页面的请求页面

Mainly configures the address requested by the backend.

5. The effect is as follows

5.1 Database list page

MySQL monitoring tool mysql-monitor detailed explanation

5.2 Database details page

MySQL monitoring tool mysql-monitor detailed explanation

5.3 Table list page

MySQL monitoring tool mysql-monitor detailed explanation

5.4 Table details page

MySQL monitoring tool mysql-monitor detailed explanation

##5.5 sql Analysis interface

MySQL monitoring tool mysql-monitor detailed explanation

More functions will be developed later. . . Waiting. .

7. Goal

The ultimate goal is to realize the integration of mysql operation and maintenance monitoring, and it is only for MySQL, regardless of other databases. The main goal is to achieve

In the future, developers only need to be able to use MySQL and use this tool, and it will automatically help us analyze the bad parts of the table and the bad parts of SQL writing
Let developers rely on This can be used as a MySQL DBA

Features currently thought of

  • SQL execution optimization, developers, wrote a SQL, I don’t know whether the performance is good or not, I just need to add it to the page , click to enter SQL, and then various

  • executions will be simulated and drawn into a table to display various optimized SQL executions. This requires Antlr for lexical analysis and syntax analysis.

  • Automatically analyze the table structure, for example, if varchar (100) is set, if your data only uses 50 bytes, then calculate the space lost by your field, disk

  • Automatically sample the index to form a tree diagram and display it on the page, giving us a rough idea of ​​the real look of the index we created

  • Extensive performance monitoring Figure

Recommended tutorial: "

MySQL Tutorial"

The above is the detailed content of MySQL monitoring tool mysql-monitor detailed explanation. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete