-
Notifications
You must be signed in to change notification settings - Fork 1
Home
joshcanfield edited this page Mar 28, 2012
·
9 revisions
Tapestry Monitoring is intended to be a lightweight, unobtrusive method to introduce JMX performance metrics to any application built with the Apache Tapestry Web Framework.
javasimon was chosen as the basis for the metrics for it's ease of use, highly performant stopwatch functionality and ready to use MBeans.
Monitoring functionality can be added to any IOC Service or Component method. In the simplest case the @Monitor annotation can simply be added to the method and an MBean will automatically be created and registered using the tapestry-jmx MBeanSupport.
package org.example.testapp.pages;
...
public class Index {
@Monitor
void onActivate(EventContext args) throws InterruptedException { }
@Monitor
Block onUpdateZone() {}
}
Creates two JMX MBeans
org.example.testapp:package=pages,name=Index,monitor=onActivate(EventContext),type=Monitor
org.example.testapp:package=pages,name=Index,monitor=onUpdateZone,type=Monitor
Which can now be monitored via your favorite JMX tools (see VisualVM)
<dependency>
<groupId>com.joshcanfield</groupId>
<artifactId>tapestry-monitoring</artifactId>
<version>1.0.1</version>
</dependency>