| 78 | // } |
| 79 | |
| 80 | @Test |
| 81 | public void printThreadStats() throws Exception { |
| 82 | final StatsRpc rpc = new StatsRpc(); |
| 83 | HttpQuery query = NettyMocks.getQuery(tsdb, "/api/stats/threads"); |
| 84 | rpc.execute(tsdb, query); |
| 85 | assertEquals(HttpResponseStatus.OK, query.response().getStatus()); |
| 86 | final String json = |
| 87 | query.response().getContent().toString(Charset.forName("UTF-8")); |
| 88 | assertNotNull(json); |
| 89 | // check for some standard JVM threads since we can't mock Thread easily |
| 90 | assertTrue(json.contains("\"name\":\"Finalizer\"")); |
| 91 | assertTrue(json.contains("java.lang.ref.Finalizer$FinalizerThread.run")); |
| 92 | } |
| 93 | |
| 94 | @Test |
| 95 | public void printJVMStats() throws Exception { |