|
|
@ -48,13 +48,11 @@ import de.anomic.yacy.yacyVersion;
|
|
|
|
|
|
|
|
|
|
|
|
public class Threaddump_p {
|
|
|
|
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) {
|
|
|
|
public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch<?> env) {
|
|
|
|
|
|
|
|
|
|
|
|
prop.clear();
|
|
|
|
serverObjects prop = new serverObjects();
|
|
|
|
sb = (plasmaSwitchboard) env;
|
|
|
|
plasmaSwitchboard sb = (plasmaSwitchboard) env;
|
|
|
|
|
|
|
|
|
|
|
|
final StringBuilder buffer = new StringBuilder(1000);
|
|
|
|
final StringBuilder buffer = new StringBuilder(1000);
|
|
|
|
|
|
|
|
|
|
|
|
final boolean plain = post.get("plain", "false").equals("true");
|
|
|
|
final boolean plain = post.get("plain", "false").equals("true");
|
|
|
@ -74,9 +72,11 @@ public class Threaddump_p {
|
|
|
|
bufferappend(buffer, plain, "");
|
|
|
|
bufferappend(buffer, plain, "");
|
|
|
|
bufferappend(buffer, plain, "");
|
|
|
|
bufferappend(buffer, plain, "");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int multipleCount = 1000;
|
|
|
|
if (post != null && post.containsKey("multipleThreaddump")) {
|
|
|
|
if (post != null && post.containsKey("multipleThreaddump")) {
|
|
|
|
|
|
|
|
multipleCount = post.getInt("count", multipleCount);
|
|
|
|
final ArrayList<Map<Thread,StackTraceElement[]>> traces = new ArrayList<Map<Thread,StackTraceElement[]>>();
|
|
|
|
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());
|
|
|
|
traces.add(Thread.getAllStackTraces());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
appendStackTraceStats(sb.getRootPath(), buffer, traces, plain, Thread.State.BLOCKED);
|
|
|
|
appendStackTraceStats(sb.getRootPath(), buffer, traces, plain, Thread.State.BLOCKED);
|
|
|
@ -98,6 +98,7 @@ public class Threaddump_p {
|
|
|
|
|
|
|
|
|
|
|
|
bufferappend(buffer, plain, "************* End Thread Dump " + dt + " *******************");
|
|
|
|
bufferappend(buffer, plain, "************* End Thread Dump " + dt + " *******************");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
prop.put("plain_count", multipleCount);
|
|
|
|
prop.put("plain_content", buffer.toString());
|
|
|
|
prop.put("plain_content", buffer.toString());
|
|
|
|
prop.put("plain", (plain) ? 1 : 0);
|
|
|
|
prop.put("plain", (plain) ? 1 : 0);
|
|
|
|
|
|
|
|
|
|
|
|