Skip to content

Reference To web.xml Configuration

eostermueller edited this page Nov 18, 2014 · 11 revisions

The wuqiSpank web.xml is located here:

.extract/webapps/wuqiSpank/WEB-INF/web.xml

The above .extract directory is created as a child directory of the 'current directory' when you launch java -jar wuqiSpank.jar. This is how Tomcat unzips itself onto the file system (documentation ). The folder structure looks like this:

export-dir
.extract/
├── conf
├── logs
├── webapps
│   ├── wuqiSpank
│   │   ├── WEB-INF
│   │   │   ├── classes
│   │   │   └── lib
└── work

Export Dir

The only way to save your wuqiSpank traces to disk is by clicking the "Export to File" button. Elsewise, the JDBC-captured traces will be lost when you restart the wuqiSpank web app. If the export-dir doesn't exist at startup, wuqiSpank will attempt to create it.

By default, exported traces are stored in the export-dir folder, which is a child folder of the directory where you started wuqiSpank. For instance, if you started wuqiSpank in this folder:

c:\foo>java -jar wuqiSpank-?.??.jar

Then your export-dir will be in this location:

c:\foo\export-dir

You can change this by updating this configuration in web.xml (.extract/webapps/wuqiSpank/WEB-INF/web.xml):

<context-param>
        <param-name>export-dir</param-name>
        <param-value>c:/wuqiSpank/my-export-dir</param-value>
</context-param>	

Trace Remote Host

By default, wuqiSpank tries to trace SQL from an intrace-agent.jar file that is listening on port 9123 (intrace default) on localhost.

If instead, you want wuqiSpank to trace SQL from an intrace-agent.jar deployed on a separate machine, you'll need to specify that parameter as follows:

    <context-param>
        <param-name>intrace-agent-host</param-name>
        <param-value>otherserver.com</param-value>
    </context-param>

Non-default port for intrace-agent.jar

    <context-param>
        <param-name>intrace-agent-port</param-name>
        <param-value>9121</param-value>
    </context-param>

Why would you ever use this? To trace SQL from two different web applications on the same machine. You will need two instances of wuqiSpank, one for each webApp.

WebApp #1

Step 2-2 of the Getting Started instructions detail the intrace-agent.jar parameters. To the end of that long parameter, add the following as specified here:

[serverport-9121

wuqiSpank #1

Create two folders, wuqiSpank-one and wuqiSpank-two. You'll need one wuqiSpank for each webApp you want to trace. In wuqiSpank-one/.extract/webapps/wuqiSpank/WEB-INF/web.xml set the intrace-agent-port to 9121 as detailed above. When you launch wuqiSpank.jar, append -httpPort 8121. The browser url to see SQL from WebApp #1 will be http://localhost:8121/wuqiSpank

WebApp #2

Step 2-2 of the Getting Started instructions detail the intrace-agent.jar parameters. To the end of that long parameter, add the following as specified here:

[serverport-9122

wuqiSpank #2

In wuqiSpank-two/.extract/webapps/wuqiSpank/WEB-INF/web.xml set the intrace-agent-port to 9122 as detailed above. When you launch wuqiSpank.jar, append -httpPort 8122. The browser url to see SQL from WebApp #1 will be http://localhost:8122/wuqiSpank

Cache for Static Data

Use this syntax in wuqiSpank web.xml:

<context-param>
        <param-name>cached-tables</param-name>
        <param-value>physical_plant, product_cfg</param-value>
</context-param>	

..to highlight the table names 'physical_plant' and 'product_cfg' in blue (blue like a slow moving glacier). As shown, multiple tables must be separated by commas. See how the digit '4' is circled in blue, below? Blue is wuqiSpank's 'reserved color' to indicate when a table with mostly 'static' data should be cached with a solution like EHCache. When a developer see a blue table, they must insure that all the queries to it are backed by an in-memory cache. static-blue

Watch for growth in a SELECT N+1 Table

Use this syntax in wuqiSpank web.xml:

<context-param>
        <param-name>growth-tables</param-name>
        <param-value>big_ams, tran_hist</param-value>
</context-param>	

..to highlight the table name 'big_ams' in red. See how the digit '9' is circled in red, below? Red is wuqiSpank's 'reserved color' to indicate when a table with data that is frequently changing (INSERT included). When a developer sees a red table, they must insure they they minimize queries to this table, because it will grow large, especially in production. dynamic-red

Clone this wiki locally