mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improve proxy performance
This commit is contained in:
@@ -33,7 +33,7 @@ public class MySqlPerfMain_visitor {
|
||||
|
||||
String sql = "SELECT ID, NAME, AGE FROM USER WHERE ID = ?";
|
||||
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
perfMySql(sql);
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ public class MySqlPerfMain_visitor {
|
||||
List<SQLStatement> statementList = parser.parseStatementList();
|
||||
|
||||
long startMillis = System.currentTimeMillis();
|
||||
for (int i = 0; i < 1000 * 100 * 1; ++i) {
|
||||
for (int i = 0; i < 1000 * 1000 * 1; ++i) {
|
||||
execMySql(statementList);
|
||||
}
|
||||
long millis = System.currentTimeMillis() - startMillis;
|
||||
|
||||
@@ -29,22 +29,6 @@ import com.alibaba.druid.wall.WallUtils;
|
||||
* @see
|
||||
*/
|
||||
public class MySqlWallTest1 extends TestCase {
|
||||
|
||||
/**
|
||||
* @param name
|
||||
*/
|
||||
public MySqlWallTest1(String name){
|
||||
super(name);
|
||||
}
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
public void test_stuff() throws Exception {
|
||||
Assert.assertTrue(WallUtils.isValidateMySql(//
|
||||
"select count(*) from (select DATE_FORMAT(staydate,'%m月') as month,sum(a) as addnum,sum(q) as quitnum from (select staydate,1 as a,0 as q from add_person union all select quitdate,0 as a,1 as q from quit_person) t where (DATE_FORMAT(staydate,'%Y')= ? ) group by DATE_FORMAT(staydate,'%Y-%m'))"));
|
||||
|
||||
Reference in New Issue
Block a user