提交 5cfd9912 authored 作者: Thomas Mueller's avatar Thomas Mueller

better trace messages

上级 5f1bd724
......@@ -34,17 +34,17 @@ public class TestMemoryUsage extends TestBase {
public void test() throws SQLException {
deleteDb("memoryUsage");
// testCreateDropLoop();
testCreateDropLoop();
testCreateIndex();
// testClob();
// deleteDb("memoryUsage");
// testReconnectOften();
// deleteDb("memoryUsage");
// reconnect();
// insertUpdateSelectDelete();
// reconnect();
// insertUpdateSelectDelete();
// conn.close();
testClob();
deleteDb("memoryUsage");
testReconnectOften();
deleteDb("memoryUsage");
reconnect();
insertUpdateSelectDelete();
reconnect();
insertUpdateSelectDelete();
conn.close();
deleteDb("memoryUsage");
}
......@@ -107,17 +107,14 @@ public class TestMemoryUsage extends TestBase {
}
Connection conn = getConnection("memoryUsage");
Statement stat = conn.createStatement();
stat.execute("create table test(id int, name varchar)");
int todo;
// PreparedStatement prep = conn.prepareStatement("insert into test values(?, space(200) || ?)");
stat.execute("create table test(id int, name varchar(255))");
PreparedStatement prep = conn.prepareStatement("insert into test values(?, space(200))");
int len = getSize(10000, 100000);
for (int i = 0; i < len; i++) {
// if(i % 1000 == 0) {
// System.out.println(" " + i + " of " + len + " used KB: " + MemoryUtils.getMemoryUsed());
// }
if (i % 1000 == 0) {
// trace("[" + i + "/" + len + "] KB: " + MemoryUtils.getMemoryUsed());
}
prep.setInt(1, i);
// prep.setInt(2, i);
prep.executeUpdate();
}
int start = MemoryUtils.getMemoryUsed();
......
......@@ -9,6 +9,7 @@ package org.h2.test.unit;
import java.sql.SQLException;
import org.h2.constant.SysProperties;
import org.h2.message.Trace;
import org.h2.store.DataHandler;
import org.h2.store.DataPage;
import org.h2.store.FileStore;
......@@ -157,4 +158,8 @@ public class TestDataPage extends TestBase implements DataHandler {
return TempFileDeleter.getInstance();
}
public Trace getTrace() {
return null;
}
}
......@@ -9,6 +9,7 @@ package org.h2.test.unit;
import java.util.Random;
import org.h2.constant.SysProperties;
import org.h2.message.Trace;
import org.h2.store.DataHandler;
import org.h2.store.FileStore;
import org.h2.test.TestBase;
......@@ -192,4 +193,8 @@ public class TestFile extends TestBase implements DataHandler {
return TempFileDeleter.getInstance();
}
public Trace getTrace() {
return null;
}
}
......@@ -12,6 +12,7 @@ import java.util.HashMap;
import java.util.Random;
import org.h2.constant.SysProperties;
import org.h2.message.Trace;
import org.h2.store.DataHandler;
import org.h2.store.FileStore;
import org.h2.test.TestBase;
......@@ -157,4 +158,8 @@ public class TestValueHashMap extends TestBase implements DataHandler {
return TempFileDeleter.getInstance();
}
public Trace getTrace() {
return null;
}
}
......@@ -18,6 +18,7 @@ import java.util.Random;
import org.h2.constant.SysProperties;
import org.h2.engine.Constants;
import org.h2.message.Message;
import org.h2.message.Trace;
import org.h2.store.DataHandler;
import org.h2.store.FileStore;
import org.h2.test.TestBase;
......@@ -248,4 +249,8 @@ public class TestValueMemory extends TestBase implements DataHandler {
return TempFileDeleter.getInstance();
}
public Trace getTrace() {
return null;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论