Tuesday, April 26, 2016

How can I get JAMon metrics in JConsole (via JMX)

Leave a Comment

As per this document we should be able to view JAmon metrics in JConsole. However I just can't find anything about JAmon in my JConsole session:

enter image description here

The session is connected to a local Catalina (tomcat 7) instance running an application with JAMon dependencies (jamon-2.80.jar). I have the following code in the application:

@RequestMapping(value = "/order/list", method = RequestMethod.GET) public String orderList(String q, int page, ModelMap modelMap) {     Monitor monitor = MonitorFactory.start(MON_ORDER_LIST);     try {         List<Order> orderList = Order.find(q, PAGE_SIZE, page * PAGE_SIZE);         modelMap.put("orderList", orderList);     } finally {         monitor.stop();     }     return jsonTemplate("order_list"); } 

And I start the tomcat instance using Intellij.

1 Answers

Answers 1

In order to view JMX informations you must explicitly call

JmxUtils.registerMbeans(); 
If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment