Change comment:
Added doc on how to setup JavaMelody
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -2,7 +2,8 @@ 2 2 {{toc/}} 3 3 {{/box}} 4 4 5 -There are 2 solutions you can use to monitor a running XWiki instance: 5 +There are various solutions you can use to monitor a running XWiki instance: 6 +* Install and configure [[JavaMelody>>http://code.google.com/p/javamelody/]] 6 6 * [[Use a Profiler>>http://dev.xwiki.org/xwiki/bin/view/Community/Profiling]]. This has the advantage of providing advanced information, but has the drawback of being resource intensive and thus slowing the XWiki instance. It also requires a special startupscript. 7 7 * Starting with XWiki Enterprise 2.4M2 we're now using the [[JMX Technology>>http://en.wikipedia.org/wiki/Java_Management_Extensions]] to provide runtime monitoring of XWiki instances. The following features are currently available: 8 8 ** Monitor the Velocity macro caches ... ... @@ -14,6 +14,42 @@ 14 14 XWiki also has a [[Monitor Plugin>>platform:AdminGuide.Logging#HActivatingtheXWikimonitoringfeature]] that you can use to monitor execution times. However this plugin is going to be deprecated in the future and replaced by the JMX technology. 15 15 {{/info}} 16 16 18 += JavaMelody = 19 + 20 +[[image:http://javamelody.googlecode.com/svn/trunk/javamelody-core/src/site/resources/screenshots/graphs.png>>http://code.google.com/p/javamelody/wiki/Screenshots||style="width:50%"]] 21 + 22 +To install JavaMelody for XWiki follow these steps (see the [[JavaMelody user guide for more details>>http://code.google.com/p/javamelody/wiki/UserGuide]]): 23 +* Download the latest [[javamelody.jar>>http://code.google.com/p/javamelody/downloads/list]] and [[jrobin-x.jar>>http://javamelody.googlecode.com/files/jrobin-1.5.9.jar]] and put them in ##WEB-INF/lib## 24 +* Edit ##web.xml## and add the following information:((( 25 +{{code}} 26 +... 27 +<filter> 28 + <filter-name>monitoring</filter-name> 29 + <filter-class>net.bull.javamelody.MonitoringFilter</filter-class> 30 +</filter> 31 +... other <filter>s from the default web.xml here ... 32 + 33 +<filter-mapping> 34 + <filter-name>monitoring</filter-name> 35 + <url-pattern>/*</url-pattern> 36 +</filter-mapping> 37 +... other <filter-mapping>s from the default web.xml here ... 38 + 39 +<listener> 40 + <listener-class>net.bull.javamelody.SessionListener</listener-class> 41 +</listener> 42 +... other <listener>s from the default web.xml here ... 43 +... 44 +{{/code}} 45 +))) 46 +* Edit ##hibernate.cfg.xml## and add:((( 47 +{{code}} 48 +<property name="jdbc.factory_class">net.bull.javamelody.HibernateBatcherFactory</property> 49 +{{/code}} 50 +))) 51 + 52 +Then restart XWiki and access JavaMelody at ##http:~//localhost:8080/xwiki/monitoring##. 53 + 17 17 = JMX Console = 18 18 19 19 Since JMX is a standard you can use [[any JMX-compatible monitoring console>>http://stackoverflow.com/questions/1744900/what-is-the-best-or-most-commonly-used-jmx-console-client]] (most application servers provide a web-based JMX console). There's also such a console called [[JConsole>>http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html]] and which is bundled by default in the Java Runtime you're using. To start it, simply execute the ##jconsole## executable. ... ... @@ -67,4 +67,3 @@ 67 67 = Using Groovy = 68 68 69 69 It's possible to [[write a Groovy script in a wiki page to access the JMX MBeans>>extensions:Extension.JMX Access]]. 70 -