improve proxy performance

This commit is contained in:
wenshao
2013-01-17 01:54:44 +08:00
parent 048b6afb19
commit 9175690675
4 changed files with 351 additions and 117 deletions
@@ -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'))"));