[bs-87] Add /dump endpoint
* Just dumps ThreadInfo, simple but effective * Implementation is part of TraceEndpoint [Fixes #49056831]
This commit is contained in:
parent
a968b140cc
commit
cee78386ee
|
|
@ -45,6 +45,9 @@ public class EndpointsProperties {
|
|||
@Valid
|
||||
private Endpoint trace = new Endpoint("/trace");
|
||||
|
||||
@Valid
|
||||
private Endpoint dump = new Endpoint("/dump");
|
||||
|
||||
public Endpoint getVarz() {
|
||||
return this.varz;
|
||||
}
|
||||
|
|
@ -65,6 +68,10 @@ public class EndpointsProperties {
|
|||
return this.trace;
|
||||
}
|
||||
|
||||
public Endpoint getDump() {
|
||||
return this.dump;
|
||||
}
|
||||
|
||||
public static class Endpoint {
|
||||
|
||||
@NotNull
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@
|
|||
|
||||
package org.springframework.bootstrap.service.trace;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.ThreadInfo;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
|
@ -44,4 +47,11 @@ public class TraceEndpoint {
|
|||
return this.tracer.traces();
|
||||
}
|
||||
|
||||
@RequestMapping("${endpoints.dump.path:/dump}")
|
||||
@ResponseBody
|
||||
public List<ThreadInfo> dump() {
|
||||
return Arrays.asList(ManagementFactory.getThreadMXBean().dumpAllThreads(true,
|
||||
true));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue