com.emc.mongoose.api.model.concurrent.ThreadDump Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mongoose-api-model Show documentation
Show all versions of mongoose-api-model Show documentation
Mongoose is a high-load storage performance testing tool
package com.emc.mongoose.api.model.concurrent;
import java.util.Map;
/**
Created by andrey on 08.08.17.
*/
public final class ThreadDump {
private final Map threadDumpData = Thread.getAllStackTraces();
@Override
public final String toString() {
final StringBuilder threadDumpStr = new StringBuilder();
final String lineSep = System.lineSeparator();
for(final Thread thread : threadDumpData.keySet()) {
threadDumpStr
.append(thread.getName())
.append(" (state: ")
.append(thread.getState())
.append("):")
.append(lineSep);
final StackTraceElement[] threadStackTrace = threadDumpData.get(thread);
for(final StackTraceElement ste : threadStackTrace) {
threadDumpStr
.append('\t')
.append(ste)
.append(lineSep);
}
}
return threadDumpStr.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy