Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
added option to create a custom number of thread dumps in multiple thread dumps
orbitere52c3eb79d0d
diff --git a/htroot/Threaddump_p.html b/htroot/Threaddump_p.htmlindex fa1d63e44..c7551e51c 100644--- a/htroot/Threaddump_p.html+++ b/htroot/Threaddump_p.html@@ -9,13 +9,20 @@#%env/templates/header.template%##%env/templates/submenuViewLog.template%#<h2>Threaddump</h2>- <form action="Threaddump_p.html" method="get" >+ <table border="0" cellpadding="0" cellspacing="0"><tr>+ <td><form action="Threaddump_p.html" method="get" ><fieldset><input type="submit" name="singleThreaddump" value="Single Threaddump" />+ </fieldset>+ </form></td>++ <td><form action="Threaddump_p.html" method="get" >+ <fieldset>+ <input type="text" name="count" value="#[count]#" size="4" maxlength="4" /><input type="submit" name="multipleThreaddump" value="Multiple Dump Statistic" /></fieldset>- </form>-+ </form></td>+ </tr></table><div><tt>#[content]#</tt>diff --git a/htroot/Threaddump_p.java b/htroot/Threaddump_p.javaindex 8193e9002..de0113fdc 100644--- a/htroot/Threaddump_p.java+++ b/htroot/Threaddump_p.java@@ -48,13 +48,11 @@ import de.anomic.yacy.yacyVersion;public class Threaddump_p {- private static final serverObjects prop = new serverObjects();- private static plasmaSwitchboard sb = null;-public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch<?> env) {-- prop.clear();- sb = (plasmaSwitchboard) env;++ serverObjects prop = new serverObjects();+ plasmaSwitchboard sb = (plasmaSwitchboard) env;+final StringBuilder buffer = new StringBuilder(1000);final boolean plain = post.get("plain", "false").equals("true");@@ -74,9 +72,11 @@ public class Threaddump_p {bufferappend(buffer, plain, "");bufferappend(buffer, plain, "");+ int multipleCount = 1000;if (post != null && post.containsKey("multipleThreaddump")) {+ multipleCount = post.getInt("count", multipleCount);final ArrayList<Map<Thread,StackTraceElement[]>> traces = new ArrayList<Map<Thread,StackTraceElement[]>>();- for (int i = 0; i < 1000; i++) {+ for (int i = 0; i < multipleCount; i++) {traces.add(Thread.getAllStackTraces());}appendStackTraceStats(sb.getRootPath(), buffer, traces, plain, Thread.State.BLOCKED);@@ -98,6 +98,7 @@ public class Threaddump_p {bufferappend(buffer, plain, "************* End Thread Dump " + dt + " *******************");+ prop.put("plain_count", multipleCount);prop.put("plain_content", buffer.toString());prop.put("plain", (plain) ? 1 : 0);