Assessing Performance

Requires Platform 4.2+

Assessing Application Load Time Peformance

In Nexaweb 4.2.x and later, you can capture HTTP session information in-memory or to an XML log file in order to view the HTTP session activity occurring on your application's client as your application loads.

You can setup Nexaweb to capture client HTTP session information:

  • At the Nexaweb console only
  • In separate log files for each session (in addition to the console)

You setup Nexaweb to capture HTTP session logs by adding a filter, ServletFilter (javax.servlet.Filter), to the Web.xml configuration file. This filter does not modify any part of the request or response ensuring that it does not interfere with operation. It tracks all requests made over the course of all HTTP sessions.

Understanding the Information Captured

When you setup Nexaweb to capture HTTP session logs, Nexaweb captures client information for any HTTP session.
Nexaweb only records requests made in the context of an HTTP session. Nexaweb always uses an HTTP session to request the initial page. Nexaweb creates the session log file, if configured to do so, when the HTTP session exits.

An HTTP session XML log file appears similar to the following:

<?xml version="1.0" encoding="UTF-8"?>
 <singleHttpSessionRequestInfo>
   <sessionInfo>
     <httpSessionId>1p2pDxvnXTdXuChbKE0pgNC</httpSessionId>
   </sessionInfo>
   <requestItems>
     <requestItem>
       <url>http://phobos:9080/Print90/Nexaweb/Services/index.jsp</url>
       <nxSession>null</nxSession>
       <responseCode>200</responseCode>
       <contentType>text/html;charset=ISO-8859-1</contentType>
       <contentLength>6548</contentLength>
       <hasHttpSessionAtStart>false</hasHttpSessionAtStart>
       <hasNxSessionAtStart>false</hasNxSessionAtStart>
       <hasHttpSessionAtEnd>true</hasHttpSessionAtEnd>
       <hasNxSessionAtEnd>false</hasNxSessionAtEnd>
       <startTimeInMilliSeconds>1137502988180</startTimeInMilliSeconds>
       <endTimeInMilliSeconds>1137502988180</endTimeInMilliSeconds>
       <startTimeIntervalInMilliSeconds>0</startTimeIntervalInMilliSeconds>
      </requestItem>
   </singleHttpSessionRequestInfo>

For each session, Nexaweb records the information described in the following table:

SectionDescription
<singleHTTPSessionRequestInfo> </singleHTTPSessionRequestInfo>Contains all of the information captured for each session.
<sessionInfo> </sessionInfo>Contains a single <httpSessionId> </httpSessionId> tag that identifies this HTTP session by ID and client information, if available.
<requestItems> </requestItems>Contains one or more <requestItem> </requestItem> tags, each specifying details of a single HTTP request associated with this session.

For each request (<requestItem> </requestItem>), Nexaweb records the information described in the following table:

RequestDescription
<url> </url>The URL of the request as returned by HttpServletRequest.getRequestURL().
<nxsession> </nxsession>Nexaweb Session ID (if one exists).
<responseCode> </responseCode>Response code as captured by wrapping the HttpServletResponse.setStatus() method. If no response received, Nexaweb sets this to 200.
<contentType> </contentType>Content type of the response as captured by wrapping the HttpServletResponse.setContentType() method. If no response received, Nexaweb sets the content type to "text/html".
<contentLength> </contentLength>Size of content returned in bytes captured by wrapping the output stream and recording the number of bytes in each write call.
<hasHttpSessionAtStart> </hasHttpSessionAtStart>Specifies whether an HTTP session exists at the beginning of the request.
Values include:
- True (yes)
- False (no)
<hasNxSessionAtStart> </hasNxSessionAtStart>Specifies whether a Nexaweb Session exists at the beginning of the request.
Values include:
- True (yes)
- False (no)
<hasHttpSessionAtEnd> </hasHttpSessionAtEnd>Specifies whether an HTTP session exists at the end of the request.
Values include:
- True (yes)
- False (no)
<hasNxSessionAtEnd> </hasNxSessionAtEnd>Specifies whether a Nexaweb Session exists at the end of the request.
Values include:
- True (yes)
- False (no)
<startTimeInMilliSeconds> </startTimeInMilliSeconds>Request start time GMT in milliseconds.
<endTimeInMilliSeconds> </endTimeInMilliSeconds>Request end time GMT in milliseconds.
<startTimeIntervalInMilliSeconds> </startTimeIntervalInMilliSeconds>The interval in milliseconds between the start of this request and the start of the last request in this session.

The HTTP session log displays all times in milliseconds. It calculates time using System.currentTimeMillis(); however, on Windows platforms the accuracy of System.currentTimeMillis() can be as granular as 10 ms.

Requests may occur simultaneously. Therefore, you cannot assume that a certain request created a session that exists at the end of that request, even if the session did not exist at the beginning of that request; another session occurring at the same time may have created the session.

Setting Up Nexaweb to Capture HTTP Session Information

You can setup Nexaweb to:

  • Capture HTTP session information
  • Save it to an XML file

If you do not setup Nexaweb to save the HTTP session information to a file, you can view the HTTP session information at the Nexaweb console only.

If you setup Nexaweb to save the HTTP session information to a file, Nexaweb:

  • Saves informaton for each session in a separate file
  • Creates the XML session log file when the session ends

You setup Nexaweb to capture HTTP session information by adding a filter and optional listener to the the Web.xml configuration file. Add these to a version of the Web.xml file that you use in your development or testing environment only. Do not add this filter and listener to a Web.xml file that you use in a production version of your application, as the processes for capturing HTTP session information will cause your application's client to run slowly.

To setup Nexaweb to capture HTTP session information, follow these steps:

  1. Locate the Web.xml file in your application's WebContent\WEB-INF directory.
  2. Open it with a text editor.
  3. Add the following lines for the filter that captures the HTTP request information:

     <filter>
      <filter-name>ClientRequestProfilingFilter</filter-name>
      <filter-class>
        com.nexaweb.server.servlet.ClientRequestProfilingFilter
      </filter-class>
      <init-param>
           <param-name>outputFolder</param-name>
           <param-value>a_fully_ph_pathname</param-value>
      </init-param>
    </filter>
    <filter-mapping>
      <filter-name>ClientRequestProfilingFilter</filter-name>
      <url-pattern>/*</url-pattern>
    </filter-mapping>
  4. To save the HTTP session logs to files, specify the directory name in the <param-name> </param-name> tags, and specify a fully qualified path to this directory in the <param-value> </param-value> tags.
  5. Specify the pattern of the URLs to capture between the <url-pattern>*</url-pattern> tags as a literal URL or using the * wildcard to match URLs. For example, * matches all files, *.jsp matches all JSP files, and so forth.
  6. To save the HTTP session logs to files, add the following lines to configure the HttpSessionListener, which provides notification when a session ends:

    <listener>
      <listener-class>
        com.nexaweb.server.servlet.ClientRequestProfilingFilter
      </listener-class>
    </listener>
        
  7. Save and close the Web.xml file.

Viewing HTTP Session Logs at the Nexaweb Console

To view HTTP session logs at the Nexaweb console, follow these steps:

  1. Go to the Nexaweb console.
  2. Click HTTP sessions under Session Information.
    A Client HTTP Request Information list appears, containing links to the logs created for each of the HTTP session IDs listed.
  3. Click one of the HTTP session IDs to view the log for that session, or click Show All HTTP Session Request Information to see logs or all of the sessions in one file.