1

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.

Anil_M
  • 10,893
  • 6
  • 47
  • 74
Gelin Luo
  • 14,035
  • 27
  • 86
  • 139
  • I've tested jamon on both windows and ubuntu with java 8. No JAMon monitors are displayed by jConsole. Manually creating a custom jmx monitor works fine for a simple console app. – johnlemon Apr 19 '16 at 18:28

1 Answers1

2

In order to view JMX informations you must explicitly call

JmxUtils.registerMbeans();
johnlemon
  • 20,761
  • 42
  • 119
  • 178