Skip to content
joshcanfield edited this page Mar 28, 2012 · 9 revisions

Tapestry Monitoring

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.

Examples

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)

More Examples

Download

<dependency>
    <groupId>com.joshcanfield</groupId>
    <artifactId>tapestry-monitoring</artifactId>
    <version>1.0.1</version>
</dependency>
Clone this wiki locally