Overview | Example | Building | Installation | History
Watt helps in understanding how web applications interact with the database by collecting information about each query that is run, and tying it to the request that caused the query.
To use Watt, you need at a minimum a Java development environment and a web application that interacts with the database and runs inside Tomcat. (Watt is likely to work with other servlet containers, but currently has only been used with Tomcat 5)
The example pages are a static dump of the information that Watt generates. Of particular interest are
To build watt, you need to do the following:
ant packin $WATT
After successfully building Watt, you need to do the following to install it under Tomcat and to instrument your web application (you will have to be root for most of these steps):
Now that Watt is installed, you need to instrument your webapp to use it:
<filter> <filter-name>WattFilter</filter-name> <filter-class>net.watzmann.watt.WattFilter</filter-class> </filter> <filter-mapping> <filter-name>WattFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
jdbc:watt:<driver_class>:<real_jdbc_url>For example, if you use MySQL, and your current JDBC URL is jdbc:mysql://localhost/mydb, change the URL to jdbc:watt:com.mysql.jdbc.Driver:mysql://localhost/mydb.
With installation complete, restart Tomcat and go to http://yourserver:yourport/watt/Index.do. You should see a page that tells you that there is no request information. Request a few pages in your web application and reload http://yourserver:yourport/watt/Index.do; you should now see information for each request that you made.
The first incarnation of this idea was implemented by Joe Banks at Arsdigita in 2001 as the developer support for Arsdigita's Java product. It continued its life as part of RedHat's CCM in various guises, and is now part of the open-source successor of CCM, Byline. Watt is a reimplementation and extension of the developer support in Byline; among other things, it can now be used with any web application and any JDBC database driver.