提交 4aee768f authored 作者: Thomas Mueller's avatar Thomas Mueller

Profiler: ignore the windows event loop

上级 4df0e737
...@@ -800,7 +800,7 @@ public class WebApp implements DatabaseEventListener { ...@@ -800,7 +800,7 @@ public class WebApp implements DatabaseEventListener {
String success = "<a class=\"error\" href=\"#\" onclick=\"var x=document.getElementById('prof').style;x.display=x.display==''?'none':'';\">" + String success = "<a class=\"error\" href=\"#\" onclick=\"var x=document.getElementById('prof').style;x.display=x.display==''?'none':'';\">" +
"${text.login.testSuccessful}</a>" + "${text.login.testSuccessful}</a>" +
"<span style=\"display: none;\" id=\"prof\"><br />" + "<span style=\"display: none;\" id=\"prof\"><br />" +
PageParser.escapeHtml(profiler.getTop(1)) + PageParser.escapeHtml(profiler.getTop(3)) +
"</span>"; "</span>";
session.put("error", success); session.put("error", success);
// session.put("error", "${text.login.testSuccessful}"); // session.put("error", "${text.login.testSuccessful}");
...@@ -1190,7 +1190,7 @@ public class WebApp implements DatabaseEventListener { ...@@ -1190,7 +1190,7 @@ public class WebApp implements DatabaseEventListener {
profiler.stopCollecting(); profiler.stopCollecting();
SimpleResultSet rs = new SimpleResultSet(); SimpleResultSet rs = new SimpleResultSet();
rs.addColumn("Top Stack Trace(s)", Types.VARCHAR, 0, 0); rs.addColumn("Top Stack Trace(s)", Types.VARCHAR, 0, 0);
rs.addRow(profiler.getTop(1)); rs.addRow(profiler.getTop(3));
profiler = null; profiler = null;
return rs; return rs;
} }
......
...@@ -22,7 +22,7 @@ public class Profiler implements Runnable { ...@@ -22,7 +22,7 @@ public class Profiler implements Runnable {
private int depth = 16; private int depth = 16;
private String[] ignoreLines = StringUtils.arraySplit("", ',', true); private String[] ignoreLines = StringUtils.arraySplit("", ',', true);
private String[] ignoreThreads = StringUtils.arraySplit( private String[] ignoreThreads = StringUtils.arraySplit(
"java.net.,java.lang.Thread.", ',', true); "java.net.,java.lang.Thread.,sun.awt.", ',', true);
private volatile boolean stop; private volatile boolean stop;
private HashMap<String, Integer> counts = new HashMap<String, Integer>(); private HashMap<String, Integer> counts = new HashMap<String, Integer>();
private int minCount = 1; private int minCount = 1;
...@@ -137,7 +137,7 @@ public class Profiler implements Runnable { ...@@ -137,7 +137,7 @@ public class Profiler implements Runnable {
*/ */
public String getTop(int max) { public String getTop(int max) {
StringBuilder buff = new StringBuilder(); StringBuilder buff = new StringBuilder();
buff.append("Profiler: top stack trace(s) [build-").append(Constants.BUILD_ID).append("]\n"); buff.append("Profiler: top ").append(max).append(" stack trace(s) [build-").append(Constants.BUILD_ID).append("]\n");
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
Map.Entry<String, Integer>[] array = new Map.Entry[counts.size()]; Map.Entry<String, Integer>[] array = new Map.Entry[counts.size()];
counts.entrySet().toArray(array); counts.entrySet().toArray(array);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论