mysqladmin-uroot-proot1234 ext Gets the status of MySQL
Queries Number of queries
threads_connected Current number of open links
threads_running number of threads concurrently executing query
The following statement allows you to query the values of the three states of the current MySQL
mysqladmin-uroot-proot1234 Ext|awk '/queries/{q=$4}/threads_connected/{c=$4}/threads_running/{r=$4}end{printf ("% D%d%d\n ", q,c,r)} '
Executes the command every second and assigns the output to the specified file
#!/bin/sh
While True
Do
mysqladmin-uroot-proot1234 Ext|awk '/queries/{q=$4}/threads_connected/{c=$4}/threads_running/{r=$4}end{printf ("% D%d%d\n ", q,c,r)} ' >>status.txt
Sleep 1;
Done
Using AB for pressure measurement
And then
awk ' {q=$1-last;last=$1}{printf ("%d%d%d\n", q,$2,$3)} ' Status.txt >>1111.txt
Make 1111.txt table observation status
MySQL Status monitoring