Author: fmeschbe
Date: Fri Jun 22 07:08:33 2012
New Revision: 1352783

URL: http://svn.apache.org/viewvc?rev=1352783&view=rev
Log:
SLING-2516 Firs documentation on the new Request Analyzer

Added:
    sling/site/trunk/content/documentation/bundles/request-analysis.mdtext
Modified:
    sling/site/trunk/content/documentation/bundles.mdtext

Modified: sling/site/trunk/content/documentation/bundles.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles.mdtext?rev=1352783&r1=1352782&r2=1352783&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/bundles.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles.mdtext Fri Jun 22 07:08:33 
2012
@@ -25,6 +25,7 @@ Title: Bundles
 * [Commons HTML Utilities]({{ refs.commons-html-utilities.path }})
 * [MIME Type Support (commons.mime)]({{ 
refs.mime-type-support-commons-mime.path }})
 * [Output Rewriting Pipelines (org.apache.sling.rewriter)]({{ 
refs.output-rewriting-pipelines-org-apache-sling-rewriter.path }})
+* [Request Processing Analyzer] (org.apache.sling.reqanalyzer)]({{ 
refs.request-analysis.path }})
 * [Sling Settings (org.apache.sling.settings)]({{ 
refs.sling-settings-org-apache-sling-settings.path }})
 * [Scheduler Service (commons scheduler)]({{ 
refs.scheduler-service-commons-scheduler.path }})
 * [Web Console Extensions (org.apache.sling.extensions.webconsolebranding, 
org.apache.sling.extensions.webconsolesecurityprovider)]({{ 
refs.web-console-extensions.path }})

Added: sling/site/trunk/content/documentation/bundles/request-analysis.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/request-analysis.mdtext?rev=1352783&view=auto
==============================================================================
--- sling/site/trunk/content/documentation/bundles/request-analysis.mdtext 
(added)
+++ sling/site/trunk/content/documentation/bundles/request-analysis.mdtext Fri 
Jun 22 07:08:33 2012
@@ -0,0 +1,44 @@
+Title: Request Processing Analyzer (reqanalyzer)
+
+[TOC]
+
+
+## Introduction
+
+Sling provides a helpful functionality to track progress of requests
+being processed: The 
[RequestProgressTracker](http://sling.apache.org/apidocs/sling6/org/apache/sling/api/request/RequestProgressTracker.html)
 which is available through the 
[SlingHttpServletRequest](http://sling.apache.org/apidocs/sling6/org/apache/sling/api/SlingHttpServletRequest.html#getRequestProgressTracker%28%29).
+
+This tool provides mechanims to record states of request processing and a 
simple mechanism to time periods of processing. By default Sling itself uses 
this tool to track progress through Sling like script resolution and calling 
scripts.
+
+Scripts and servlets called during Sling's request processing may themselves 
use the `RequestProgressTracker` to log their own processing.
+
+Usually the data collected by the `RequestProgressTracker` is just dropped or 
it may be visible for a certain number of recent requests on the *Recent 
Requests* page of the Web Console. When doing load tests, though, this Web 
Console page is of limited use because a lot more requests are handled than can 
be displayed in the Web Console.
+
+This is where the [Request Processing 
Analyzer](http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/reqanalyzer)
 comes in handy. When deployed as a bundle it registers as a request level 
servlet Filter with the Sling Main Servlet. Each request is logged in a special 
file (currently fixed at `${sling.home}/logs/requesttracker.txt`) with a header 
line provding core information on the request:
+
+* Start time stamp in ms since the Epoch
+* Request processing time in ms
+* Request Method
+* Request URL
+* Response content type (plus character encoding if available)
+* Response Status
+
+After that first line the complete data from the requests 
`RequestProgressTracker` is dumped.
+
+
+## Analyzing the `requesttracker.txt` file
+
+To analyze the `requesttracker.txt` file the *Request Processing Analyzer* 
module can also be used as a standalone Java application. Just start the module 
using the `java` command:
+
+    $ java -jar org.apache.sling.reqanalyzer-0.0.1-SNAPSHOT.jar 
requesttracker.txt
+
+The command supports two command line arguments:
+
+1. The tracker file (required)
+2. The number of requests to load and display from the file. This second 
option is optional and may be used to limit the request information loaded to 
the first requests in the file
+
+After starting and parsing the file, a window is opened showing the core 
request information in simple table. This table can be sorted by any of the 
columns by clicking on the column title.
+
+Clicking on any row opens a second window displaying the detail request 
progress information as recorded before with the `RequestProgressTracker`.
+
+The size, location, and the widths of the table columns are persisted with the 
Java Preferences API and thus when starting the application again, these 
settings are preserved.
\ No newline at end of file


Reply via email to