incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r1185762 - /sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestDispatcher.java
Date Tue, 18 Oct 2011 17:20:42 GMT
Author: justin
Date: Tue Oct 18 17:20:42 2011
New Revision: 1185762

URL: http://svn.apache.org/viewvc?rev=1185762&view=rev
Log:
SLING-2250 - adding included resource resolution timer logging

Modified:
    sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestDispatcher.java

Modified: sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestDispatcher.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestDispatcher.java?rev=1185762&r1=1185761&r2=1185762&view=diff
==============================================================================
--- sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestDispatcher.java
(original)
+++ sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestDispatcher.java
Tue Oct 18 17:20:42 2011
@@ -30,6 +30,7 @@ import javax.servlet.http.HttpServletRes
 import org.apache.sling.api.SlingConstants;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.request.RequestDispatcherOptions;
+import org.apache.sling.api.request.RequestProgressTracker;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceWrapper;
 import org.slf4j.Logger;
@@ -177,6 +178,7 @@ public class SlingRequestDispatcher impl
         SlingHttpServletRequest cRequest = RequestData.unwrap(request);
         RequestData rd = RequestData.getRequestData(cRequest);
         String absPath = getAbsolutePath(cRequest, path);
+        RequestProgressTracker requestProgressTracker = cRequest.getRequestProgressTracker();
 
         // if the response is not an HttpServletResponse, fail gracefully not
         // doing anything
@@ -187,7 +189,9 @@ public class SlingRequestDispatcher impl
         }
 
         if (resource == null) {
-
+            String timerName = "resolveIncludedResource(" + absPath + ")";
+            requestProgressTracker.startTimer(timerName);
+            
             // resolve the absolute path in the resource resolver, using
             // only those parts of the path as if it would be request path
             resource = cRequest.getResourceResolver().resolve(absPath);
@@ -199,11 +203,15 @@ public class SlingRequestDispatcher impl
                     absPath);
                 return;
             }
+            
+            requestProgressTracker.logTimer(timerName,
+                    "path={0} resolves to Resource={1}",
+                    absPath, resource);
         }
 
         // ensure request path info and optional merges
         SlingRequestPathInfo info = getMergedRequestPathInfo(cRequest);
-        cRequest.getRequestProgressTracker().log(
+        requestProgressTracker.log(
             "Including resource {0} ({1})", resource, info);
         rd.getSlingRequestProcessor().dispatchRequest(request, sResponse, resource,
             info, include);



Mime
View raw message