Introduction

Jwebap is an open-source profiler tool for j2ee application. It is pure java-based and working on any computer with jdk 1.4 and up. It is also very easy to use because it only launches two files. Following are some of its features:


High Performance: Jwebap uses ASM (A Java bytecode engineering library) to inject class to achieve runtime information. The function is very low-overhead.


Pure Java: Most profilers use the JVMPI (Java Virtual Machine Profiling Interface) and some localized interface to monitor runtime details inside JVM. However, Jwebap is written entirely in java. It has no dependency on JVM or OS. So you can easily deploy it in any platform with very low-overhead.


Abundant Analysis Tools: Jwebap is based on a plug-in architecture. Every trace analysis tool is a component. You can configure what component you should use. You can do timing filter on method execution, database statement, http request, etc. You can also view the leak connections, view the heap stack in execution, and count average execution time, over-time rate, etc. A component can be extended easily under the plug-in architecture, so Jwebap can implement more analysis components and reports in the future.


Easy To Use: When you use Jwebap, you will find it is easy to use. It has simple configure file, web console, and helpful analysis report.


You can download it here

How to use?


1: launch jarfile


Include jwebap.jar to your web application lib path. It is generally 'WEB-INF/lib/' if your application is just a web module, or the server lib path if your application is an EJB application with EAR.


2: Configure


jwebap.xml


Include jwebap.xml to your 'WEB-INF' path. Following are the properties of every component. Every component starts with '<component>' tag, ends with '</component>' tag. You can add whatever components you want in jwebap.xml:


HttpComponent

<component name="HttpComponent" type="org.jwebap.plugin.http.HttpComponent">
	<!--(ms) timings filter's over time -->
	<property name='trace-filter-active-time'>-1</property>
	<!-- max over-time trace size -->
	<property name='trace-max-size'>1000</property>
</component>


MethodComponent

<component name="MethodComponent" type="org.jwebap.plugin.method.MethodComponent">
	<property name='trace-filter-active-time'>-1</property>
	<property name='trace-max-size'>1000</property>
	<!--
		package name and class name that monitored by MethodComponent,
		e.g.: 'test.*;test.Test' , divided by ';'
	-->
	<property name='detect-clazzs'>test.*;</property>
</component>


JdbcComponent

<component name="JdbcComponent" type="org.jwebap.plugin.jdbc.JdbcComponent">
	<property name='trace-filter-active-time'>-1</property>
	<property name='trace-max-size'>1300</property>
	<property name='connection-listener'><!--Connection Listener-->
	org.jwebap.plugin.http.ServletOpenedConnectionListener;
	org.jwebap.plugin.method.MethodOpenedConnectionListener
	</property>
	<!--
		1)	Local datasource: jdbc driver class ,like 
			oracle.jdbc.driver.OracleDriver;com.mysql.jdbc.Driver, 
			divided by ';'.
		2)	JNDI datasource: If your application uses jndi datasource, 
			you can set the class which manages connections in your 
			application as driver, e.g.: 'com.china.telecom.ConnectionManager'. 
			DBComponent will inject this class to proxy all connection
			the classĄ¯s method return.
			
	-->
	<property name='driver-clazzs'></property>
</component>


web.xml


And then change your web.xml:


Add context-param to locate jwebap.xml

<context-param>
	<param-name>config</param-name>
	<param-value>/WEB-INF/jwebap.xml</param-value>
</context-param>


Add Jwebap start listener at the first of all listeners

<listener>	
	<listener-class>org.jwebap.core.JwebapListener</listener-class>	
</listener>


Add http filter for HttpComponent

<filter>
	<filter-name>PageDetectFilter</filter-name>
	<filter-class>org.jwebap.plugin.http.DetectFilter</filter-class>
	<init-param>
		<param-name>excludeUrls</param-name>
		<param-value>/detect;/detect/*;*.js;*.jpg;*.htm;*.html;*.gif;*.png;*.css;*.swf</param-value>
	</init-param>
</filter>
<filter-mapping>
	<filter-name>PageDetectFilter</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>


Add Servlet for Jwebap console

<servlet>
	<servlet-name>detect</servlet-name>
	<servlet-class>org.jwebap.ui.controler.JwebapServlet</servlet-class>	
</servlet>
<servlet-mapping>
	<servlet-name>detect</servlet-name>
	<url-pattern>/detect/*</url-pattern>
</servlet-mapping>

ScreenShots


Method Traces


Http Traces


Please use SourceForge forum for reporting any bug, comment or suggestion.

Power by