Using loadrunner tools to test the performance of mysql
This article is mainly about the use of loadrunner tools for mysql performance testing, if you are interested, let's take a look at this article. I believe that after reading the use of loadrunner tools for mysql performance testing, it is of some reference value to everyone.
download
It can be downloaded from the following URL:
Http://down.51cto.com/data/403722
Installation
So easy, unzip to your loadrunner installation directory, put the extracted include and bin directories into the loadrunner installation directory! There are a lot of children's shoes shamefully put the decompressed loadrunner mysqllibs directory below, Khan ah.
Use
No nonsense, just go to the code.
Vuser_init
# define MYSQLSERVER "XXX.XXX.XXX.XXX" # ip of mysql
# define MYSQLUSERNAME "XXX" # user name
# define MYSQLPASSWORD "XXX" # password
# define MYSQLDB "XXX" # Database
# define MYSQLPORT "XXX" # Port
# include "Ptt_Mysql.h" # introduces the h file of mysql lib
Vuser_init ()
{
Return 0
}
Look, it's easy. Haha, keep going.
Action
Action ()
{
Char chQuery [128]
MYSQL * Mconn
Lr_load_dll ("libmysql.dll"); # introducing dll of libmysql
Mconn = lr_mysql_connect (MYSQLSERVER, MYSQLUSERNAME, MYSQLPASSWORD, MYSQLDB, atoi (MYSQLPORT); # connection mysql
Sprintf (chQuery, "update table name set a=a+1 where id=123;"
);
Lr_mysql_query (Mconn, chQuery); # execute sql
Lr_mysql_disconnect (Mconn); # close connection
Return 0
}
How's it going? It is still very simple, that is, define a point variable, and then introduce a dll, the rest is the familiar sql, this is already update as an example, select and insert are roughly the same, as long as a little modification, there is no example here.
As for vuser_end, there are no changes!
Monitoring msyql
Of course, since there is testing, there must be monitoring, as for how to monitor, there are many methods in my blog, you can find it in http://xqtesting.blog.51cto.
Here I would like to introduce a few more commands:
L Show innodb status
L Show processlist
L Show open tables from db_name
What exactly does it represent? let's try Baidu yourself. it's very simple.
Is the above details about using loadrunner tools for mysql performance testing helpful to you? If you want to know more about it, you can continue to follow our industry information section.