Runtime performance monitoring made easy

JETM Springframework 1.x/2.x integration

This page describes the generic Springframework 1.x/2.x JETM integration. If you already use Spring 2.x schema based configuration please use JETM Spring 2.x integration.

Be aware that these prerequisites and constraints apply.

Performance monitoring step-by-step

The Spring Framework comes with an extremely powerful concept called "autoproxy" facility that can automatically proxy selected bean definitions. These proxies can be used to intercept calls to these beans and thus record execution times.

Step I: Initialize JETM monitoring

The following two bean definitions enable performance monitoring in your spring managed application. First we registered an instance of EtmMonitor, second we register an Interceptor that will be used later.

<bean id="etmMonitor"
      init-method="start" destroy-method="stop"/>

<bean id="etmMethodCallInterceptor"

Since the instance of EtmMonitor should exist globally you need to ensure that the bean definition happens in your spring configuration root. Otherwhise child definitions may not be able to access the monitor.

Step II: Monitor Spring managed beans

The class BeanNameAutoProxyCreator is one option to enable the "autoproxy" facility. It creates proxies of selected beans and applies interceptors to them. In the example below we apply our previously registered EtmMethodCallInterceptor to beans that end with Service. You can use concrete names or wildcards if you want.

<bean id="etmAutoProxy"

  <property name="interceptorNames">
  <property name="beanNames">

Step III: Access aggregated results

The standalone HTTP console provides access to aggregated performance results. Simply add the following fragment to your Spring configuration and point your browser to http://{HOSTNAME}:40000 to access it.

<bean id="etmHttpConsole"
      init-method="start" destroy-method="stop" autowire="constructor"/>

If your application is a web application you probably want to use the servlet based monitoring console instead. See Spring web integration for further details.

Monitoring alternative: EtmProxyFactoryBean

Similar to Spring framework TransactionProxyFactoryBean JETM ships with the class EtmProxyFactoryBean that may be used to enhance Spring beans with performance monitoring code. The example below creates an instance of using a template Factory.

<bean id="etmProxyTemplate" abstract="true"
  <property name="etmMonitor" ref="etmMonitor"/>

<bean id="someService" parent="etmProxyTemplate">
  <property name="target">
    <bean class="" autowire="constructor"/>