|
大虾们,帮个忙,我目前在测试数据库服务器群集的测试。用java vuser写了一个脚本,脚本是正常运行的。可放到controller跑一个用户 ,负载机CPU就100%。大家帮忙看下是什么问题。谢谢了
/*
* LoadRunner Java script. (Build: _build_number_)
*
* Script Description:
*
*/
import lrapi.lr;
import java.io.*;
import java.sql.*;
public class Actions
{
String conURL="jdbc:sqlserver://192.168.1.101:1433;DatabaseName=testjavavuser";
String user="sa";
String password="sa123";
Statement stat;
Connection conn;
public int init() throws Throwable {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
conn = DriverManager.getConnection(conURL,user,password);
return 0;
}//end of init
public int action() throws Throwable {
lr.start_transaction("lr_Query_data_trans");
stat=conn.createStatement();
stat.executeQuery("<QueryParm>");
lr.end_transaction("lr_Query_data_trans",lr.AUTO);
return 0;
}//end of action
public int end() throws Throwable {
stat.close();
conn.close();
return 0;
}//end of end
} |
|