InMobi/grill — pull request #6 by Amareshwari (2014-04-15 14:13:21+00:00)
Title: Add admin end point for metrics

Adds following

* all the jvm metrics to be exposed as part of server metrics
* Adds host:port/admin with end points for ping, metrics, threads and healthcheck. Healthcheck is not implemented yet
Ex:
>http://localhost:9999/admin/ping
http://localhost:9999/admin/threads
< {all jvm thread information}
>http://localhost:9999/admin/metrics
<
{
"version" : "3.0.0",
"gauges" : {
"gc.ConcurrentMarkSweep.count" : {
"value" : 0
},
"gc.ConcurrentMarkSweep.time" : {
"value" : 0
},
"gc.ParNew.count" : {
"value" : 21
},
"gc.ParNew.time" : {
"value" : 152
},
"jvm.name" : {
"value" : "pid@"
},
"jvm.uptime" : {
"value" : 48816
},
"jvm.vendor" : {
"value" : "Apple Inc. Java HotSpot(TM) 64-Bit Server VM 20.65-b04-462 (1.0)"
},
"memory.heap.committed" : {
"value" : 85000192
},
"memory.heap.init" : {
"value" : 0
},
"memory.heap.max" : {
"value" : 1065025536
},
"memory.heap.usage" : {
"value" : 0.023105556785447817
},
"memory.heap.used" : {
"value" : 24608008
},
"memory.non-heap.committed" : {
"value" : 59183104
},
"memory.non-heap.init" : {
"value" : 24317952
},
"memory.non-heap.max" : {
"value" : 136314880
},
"memory.non-heap.usage" : {
"value" : 0.4321687551645132
},
"memory.non-heap.used" : {
"value" : 58911032
},
"memory.pools.CMS-Old-Gen.usage" : {
"value" : 0.017588715834260613
},
"memory.pools.CMS-Perm-Gen.usage" : {
"value" : 0.6516127237459508
},
"memory.pools.Code-Cache.usage" : {
"value" : 0.057285308837890625
},
"memory.pools.Par-Eden-Space.usage" : {
"value" : 0.09140556227992958
},
"memory.pools.Par-Survivor-Space.usage" : {
"value" : 0.10059052660949248
},
"memory.total.committed" : {
"value" : 144183296
},
"memory.total.init" : {
"value" : 24317952
},
"memory.total.max" : {
"value" : 1201340416
},
"memory.total.used" : {
"value" : 83519040
},
"threads.blocked.count" : {
"value" : 0
},
"threads.count" : {
"value" : 35
},
"threads.daemon.count" : {
"value" : 29
},
"threads.deadlocks" : {
"value" : [ ]
},
"threads.new.count" : {
"value" : 0
},
"threads.runnable.count" : {
"value" : 9
},
"threads.terminated.count" : {
"value" : 0
},
"threads.timed_waiting.count" : {
"value" : 8
},
"threads.waiting.count" : {
"value" : 18
}
},
"counters" : {
"com.inmobi.grill.server.GrillRequestListener.http-requests-finished" : {
"count" : 1
},
"com.inmobi.grill.server.GrillRequestListener.http-requests-started" : {
"count" : 1
},
"com.inmobi.grill.server.api.query.QueryExecutionService.finished-queries" : {
"count" : 0
},
"com.inmobi.grill.server.api.query.QueryExecutionService.queued-queries" : {
"count" : 0
},
"com.inmobi.grill.server.api.query.QueryExecutionService.running-queries" : {
"count" : 0
},
"com.inmobi.grill.server.api.query.QueryExecutionService.total-cancelled-queries" : {
"count" : 0
},
"com.inmobi.grill.server.api.query.QueryExecutionService.total-failed-queries" : {
"count" : 0
},
"com.inmobi.grill.server.api.query.QueryExecutionService.total-finished-queries" : {
"count" : 0
},
"com.inmobi.grill.server.api.query.QueryExecutionService.total-queued-queries" : {
"count" : 0
},
"com.inmobi.grill.server.api.query.QueryExecutionService.total-success-queries" : {
"count" : 0
}
},
"histograms" : { },
"meters" : { },
"timers" : { }
}