LR Test Database Summary

Source: Internet
Author: User

MySQL needs to be tested for performance at work today.

I try to do it with LR, but MySQL needs to install a OBDC MySQL drive on the computer now, then add this MySQL driver to the data source in the management tool of the computer, test the connection database successfully, OK

Returning LR, we need to use the Lr_db_connect function to connect to the database, which is only available in WebService recording.

Open the connection, note that the driver is installed above
int numrows=0;
int i;
Lr_db_connect ("Stepname=databaseconnect",
"Connectionstring=driver={mysql ODBC 5.3 ANSI DRIVER}; server=58.215.41.6; port=3306;database=dbo; User=mysqluser; Password=123456;option=3 ",
"Connectionname=mysql",
"Connectiontype=odbc", last);
Lr_start_transaction ("SQL");
Lr_db_executesqlstatement ("Stepname=performquery",
"Connectionname=mysql",
"Sqlstatement=select * from Himall_members",
"Datasetname=mysql", last);//Execute SQL statement
Lr_db_executesqlstatement ("Stepname=performquery",
"Connectionname=mysql",
"Sqlstatement=select * from Himall_skus",
"Datasetname=mysql", last);
/*lr_output_message (Lr_eval_string ("{idparam}"); */
Lr_end_transaction ("SQL", Lr_auto);
Lr_output_message ("The query returned%d rows.", NumRows);
/*lr_db_dataset_action ("Stepname=actionprint",
"Datasetname=mysql",
"Action=print",
last); *//perform operations on the database
Lr_db_disconnect ("Stepname=disconnect",
"Connectionname=mysql", last);
The value of ConnectionName is the same as the ConnectionName value in Lr_db_connect
Disconnecting from Database

But WebService needs to support Websevice's license to run the scenario.

and webservice only supports up to 100 concurrent! It's a pit!

LR Test Database Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.