/api/stats/threads

The threads endpoint is used for debugging the TSD and providing insight into the state and execution of various threads without having to resort to a JStack trace. (v2.2)

Verbs

  • GET

Requests

No parameters available.

Example Request

Query String

  1. http://localhost:4242/api/stats/threads

Response

The response is an array of objects. Fields in the response include:

Name

Data Type

Description

Example

threadID

Integer

Numeric ID of the thread

1

priority

Integer

Execution priority for the thread

5

name

String

String name of the thread, usually assigned by default

New I/O worker #23

interrupted

Boolean

Whether or not the thread was interrupted

false

state

String

One of the valid Java thread states

RUNNABLE

stack

Array<String>

A stack trace showing where execution is currently located

See Below

Example Response

  1. [
  2. {
  3. "threadID": 33,
  4. "priority": 5,
  5. "name": "AsyncHBase I/O Worker #23",
  6. "interrupted": false,
  7. "state": "RUNNABLE",
  8. "stack": [
  9. "sun.nio.ch.KQueueArrayWrapper.kevent0(Native Method)",
  10. "sun.nio.ch.KQueueArrayWrapper.poll(KQueueArrayWrapper.java:136)",
  11. "sun.nio.ch.KQueueSelectorImpl.doSelect(KQueueSelectorImpl.java:69)",
  12. "sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)",
  13. "sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)",
  14. "org.jboss.netty.channel.socket.nio.SelectorUtil.select(SelectorUtil.java:68)",
  15. "org.jboss.netty.channel.socket.nio.AbstractNioSelector.select(AbstractNioSelector.java:415)",
  16. "org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:212)",
  17. "org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)",
  18. "org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)",
  19. "org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)",
  20. "org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)",
  21. "java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)",
  22. "java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)",
  23. "java.lang.Thread.run(Thread.java:695)"
  24. ]
  25. },
  26. {
  27. "threadID": 6,
  28. "priority": 9,
  29. "name": "Signal Dispatcher",
  30. "interrupted": false,
  31. "state": "RUNNABLE",
  32. "stack": []
  33. },
  34. {
  35. "threadID": 21,
  36. "priority": 5,
  37. "name": "AsyncHBase I/O Worker #11",
  38. "interrupted": false,
  39. "state": "RUNNABLE",
  40. "stack": [
  41. "sun.nio.ch.KQueueArrayWrapper.kevent0(Native Method)",
  42. "sun.nio.ch.KQueueArrayWrapper.poll(KQueueArrayWrapper.java:136)",
  43. "sun.nio.ch.KQueueSelectorImpl.doSelect(KQueueSelectorImpl.java:69)",
  44. "sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)",
  45. "sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)",
  46. "org.jboss.netty.channel.socket.nio.SelectorUtil.select(SelectorUtil.java:68)",
  47. "org.jboss.netty.channel.socket.nio.AbstractNioSelector.select(AbstractNioSelector.java:415)",
  48. "org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:212)",
  49. "org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)",
  50. "org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)",
  51. "org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)",
  52. "org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)",
  53. "java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)",
  54. "java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)",
  55. "java.lang.Thread.run(Thread.java:695)"
  56. ]
  57. },
  58. {
  59. "threadID": 2,
  60. "priority": 10,
  61. "name": "Reference Handler",
  62. "interrupted": false,
  63. "state": "WAITING",
  64. "stack": [
  65. "java.lang.Object.wait(Native Method)",
  66. "java.lang.Object.wait(Object.java:485)",
  67. "java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)"
  68. ]
  69. },
  70. {
  71. "threadID": 44,
  72. "priority": 5,
  73. "name": "OpenTSDB Timer TSDB Timer #1",
  74. "interrupted": false,
  75. "state": "TIMED_WAITING",
  76. "stack": [
  77. "java.lang.Thread.sleep(Native Method)",
  78. "org.jboss.netty.util.HashedWheelTimer$Worker.waitForNextTick(HashedWheelTimer.java:483)",
  79. "org.jboss.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:392)",
  80. "org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)",
  81. "java.lang.Thread.run(Thread.java:695)"
  82. ]
  83. }
  84. ]