Skip to content

Commit ac4cac4

Browse files
committed
feat: add thread information to server response data
Include thread details (id, name, state) in the HTTP server response to help with debugging and monitoring thread activity.
1 parent 4afece9 commit ac4cac4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/java/mindustrytool/handler/HttpServer.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,13 @@ public void init() {
458458

459459
data.put("gameStats", gameStats);
460460
data.put("locales", Vars.locales);
461+
data.put("threads",
462+
Thread.getAllStackTraces().keySet().stream()
463+
.map(thread -> java.util.Map.of(
464+
"id", thread.getId(),
465+
"name", thread.getName(),
466+
"state", thread.getState().name()))
467+
.toList());
461468

462469
var maps = new ArrayList<HashMap<String, String>>();
463470
Vars.maps.all().forEach(map -> {

0 commit comments

Comments
 (0)