提交 11744644 authored 作者: noelgrandin's avatar noelgrandin

fix: the time value in the trace file needs to be parsed as a long

上级 6211574a
...@@ -145,7 +145,7 @@ public class ConvertTraceFile extends Tool { ...@@ -145,7 +145,7 @@ public class ConvertTraceFile extends Tool {
if (line.length() > 0) { if (line.length() > 0) {
String statement = sql; String statement = sql;
int count = 0; int count = 0;
int time = 0; long time = 0;
line = line.trim(); line = line.trim();
if (line.length() > 0) { if (line.length() > 0) {
StringTokenizer tk = new StringTokenizer(line, " :"); StringTokenizer tk = new StringTokenizer(line, " :");
...@@ -157,7 +157,7 @@ public class ConvertTraceFile extends Tool { ...@@ -157,7 +157,7 @@ public class ConvertTraceFile extends Tool {
} else if ("#".equals(token)) { } else if ("#".equals(token)) {
count = Integer.parseInt(tk.nextToken()); count = Integer.parseInt(tk.nextToken());
} else if ("t".equals(token)) { } else if ("t".equals(token)) {
time = Integer.parseInt(tk.nextToken()); time = Long.parseLong(tk.nextToken());
} }
} }
} }
...@@ -211,7 +211,7 @@ public class ConvertTraceFile extends Tool { ...@@ -211,7 +211,7 @@ public class ConvertTraceFile extends Tool {
return StringUtils.pad(String.valueOf(number), digits, " ", false); return StringUtils.pad(String.valueOf(number), digits, " ", false);
} }
private void addToStats(String sql, int resultCount, int time) { private void addToStats(String sql, int resultCount, long time) {
Stat stat = stats.get(sql); Stat stat = stats.get(sql);
if (stat == null) { if (stat == null) {
stat = new Stat(); stat = new Stat();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论