| Name | Type | Database field | Data provider (by default) | Description |
| context path | String | Webapp.webappName | ContextPathDataProvider | The path of the webapp. |
| url | String | Feature.featureName | URLDataProvider | The requested URL. |
| response code | int | HitURL.responseCode | ResponseCodeDataProvider | The HTTP response code (200, 404, ...). |
| http method | String | HitURL.method | HttpMethodDataProvider | The HTTP method requested (GET, POST, ...). |
| remote user | String | Hit.userId | UserDataProvider | The user name. |
| session id | String | Session.sessionCode | SessionDataProvider | The id of the HTTP session. |
| is new session | boolean | HitURL.isNewSession | SessionDataProvider | True if this session has just been created by this request. |
| remote IP | String | ClientHost.clientHostIP | RemoteIPDataProvider | IP address of the HTTP client. |
| query string size | int | HitURL.queryStringSize | QueryStringSizeDataProvider | The size of the query string. |
| input header size | long | HitURL.inputHeaderSize | InputHeaderSizeDataProvider | The size of the request headers. |
| input byte size | long | HitURL.inputStreamSize | InputByteSizeDataProvider | The size of the input stream that was read by the servlet. |
| output header size | long | HitURL.outputHeaderSize | OutputHeaderSizeDataProvider | The size of the response headers. |
| output byte size | long | HitURL.outputStreamSize | OutputByteSizeDataProvider | The size of the stream send in the response. |
| parameters | ListString, String | URLParam.urlParamName and URLParVal.urlParamValue | ParametersDataProvider | The parameters of the request. |
Those data are provided by classes that implements the interface org.appspy.perf.servlet.provider.DataProvider.
| ConfigBasedEnvironmentDataProvider | sets the environment code according to the value "environment" of the config property file. |
| ConfigBasedOrganizationDataProvider | sets the organization code according to the value "organization" of the config property file. |
| ContextPathDataProvider | sets the context path using HttpServletRequest.getContextPath(). |
| HostDataProvider | sets the host name using InetAddress.getLocalHost().getCanonicalHostName(). |
| HttpMethodDataProvider | sets the HTTP method using HttpServletRequest.getMethod(). |
| InputByteSizeDataProvider | sets the size of the stream read by the servlet. |
| InputHeaderSizeDataProvider | sets the size of the request headers. |
| OutputByteSizeDataProvider | sets the size of the response stream. |
| ParametersDataProvider | sets the name/values of the parameters. |
| QueryStringSizeDataProvider | sets the size of the query string. |
| RemoteIPDataProvider | sets the client ip using HttpServletRequest.getHeader("x-forwarded-for") or if not present : HttpServletRequest.getRemoteAddr() |
| ResponseCodeDataProvider | sets the result and the response code |
| ServletContextBasedApplicationDataProvider | sets the code of the application using the servlet context parameter "org.appspy.applicationName". |
| ServletContextBasedEnvironmentDataProvider | sets the code of the environment using the servlet context parameter "org.appspy.environment". (Not used in the default configuration) |
| ServletContextBasedOrganizationDataProvider | sets the code of the organization using the servlet context parameter "org.appspy.organization". (Not used in the default configuration) |
| ServletContextBasedVersionDataProvider | sets the version using the servlet context parameter "org.appspy.version". |
| SessionDataProvider | sets the session id and is new session using HttpServletRequest.getSession(false).getId() and HttpServletRequest.getSession(false).isNew() |
| TimerDataProvider | sets collection date, timer delay, cpu time, cpu user time, wait delay, wait count, blocking delay and blocking count. |
| URLDataProvider | sets the request URL. |
| UserDataProvider | sets the user of the application using HttpServletRequest.getRemoteUser(). |
The data providers are configured in the webapp configuration file (appspy-webapp-${appspy-mode}.xml).
Every data provider have to be declared in this file and added to the list of the data providers of the bean webappDataProvider.
<bean id="webappDataProvider" class="org.appspy.perf.servlet.provider.CompositeDataProvider">
<property name="dataProviders">
<list>
...
<ref bean="userProvider"/>
...
</list>
</property>
</bean>
...
<bean id="userProvider" class="org.appspy.perf.servlet.provider.UserDataProvider">
</bean>
For different reasons you may need to change the behaviour of the data collection. This can be achieved by implementing a data provider. Here is the DataProvider interface :
public interface DataProvider {
public void beforeRequest(ServletTimerData servletTimerData, HttpServletRequest req, HttpServletResponse res, ServletContext servletContext);
public void afterRequest(ServletTimerData servletTimerData, HttpServletRequest req, HttpServletResponse res, ServletContext servletContext, Throwable throwable);
}
Example : the SessionDataProvider collects informations about the HttpSession. This is done after the process of the request by the applications since the session may have not been created before.
public void beforeRequest(ServletTimerData servletTimerData, HttpServletRequest req, HttpServletResponse res,
ServletContext servletContext) {
}
public void afterRequest(ServletTimerData servletTimerData, HttpServletRequest req, HttpServletResponse res,
ServletContext servletContext, Throwable throwable) {
try
{
HttpSession session = req.getSession(false);
if (session != null)
{
servletTimerData.setSessionId(session.getId());
servletTimerData.setNewSession(session.isNew());
}
}
catch (Throwable t)
{
CollectorFactory.getCollectorInfo().setStatus(CollectorInfo.STATUS_ERROR, t);
}
}