メモ
Spring Boot 1の場合
curl -s http://localhost:8080/dump | jq '.[].threadName'
RUNNABLE
な状態のみの場合
curl -s http://localhost:8080/dump | jq '. | map(select(.threadState == "RUNNABLE"))[].threadName'
watch
したいなら
watch -n 1 "curl -s http://localhost:8080/dump | jq '. | map(select(.threadState == \"RUNNABLE\"))[].threadName'"
Spring Boot 2 (2.0.0.M7以降)の場合
2.0.0.M7からActuatorエンドポイントのprefixが変わりました。 [URL]
curl -s http://localhost:8080/actuator/threaddump | jq '.threads[].threadName'
RUNNABLE
な状態のみの場合
curl -s http://localhost:8080/actuator/threaddump | jq '.threads | map(select(.threadState == "RUNNABLE"))[].threadName'
watch
したいなら
watch -n 1 "curl -s http://localhost:8080/actuator/threaddump | jq '.threads | map(select(.threadState == \"RUNNABLE\"))[].threadName'"
Spring Boot 2 (2.0.0.M6以前)の場合
curl -s http://localhost:8080/application/threaddump | jq '.threads[].threadName'
RUNNABLE
な状態のみの場合
curl -s http://localhost:8080/application/threaddump | jq '.threads | map(select(.threadState == "RUNNABLE"))[].threadName'
watch
したいなら
watch -n 1 "curl -s http://localhost:8080/application/threaddump | jq '.threads | map(select(.threadState == \"RUNNABLE\"))[].threadName'"