Profiler

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
(remove documentation for database until bug 525 is fixed)
Line 5: Line 5:
 
   <[[web-app]] ...>
 
   <[[web-app]] ...>
 
    
 
    
     <servlet-mapping servlet-class="com.caucho.profiler.ProfilerServlet" url-pattern="/resin-profiler">
+
     <servlet-mapping servlet-class="com.caucho.tools.profiler.ProfilerServlet" url-pattern="/resin-profiler">
 
       <init>
 
       <init>
 
         <profiler enabled="true"/>
 
         <profiler enabled="true"/>

Revision as of 07:54, 12 January 2006

Resin includes high level profiling capability for profiling requests.

Contents

Enabling the Profiler

 <web-app ...>
 
   <servlet-mapping servlet-class="com.caucho.tools.profiler.ProfilerServlet" url-pattern="/resin-profiler">
     <init>
       <profiler enabled="true"/>
     </init>
     <load-on-startup/>
   </servlet-mapping>

Profiling requests

Request profiling gives insight into the time taken for requests from client browsers.

It imposes very little overhead and is suitable for production servers.

 <web-app ...>
 
   <filter filter-name="resin-profiler"
           filter-class="com.caucho.profiler.ProfilerFilter">
     <init use-query="false"/>
   </filter>
 
   <filter-mapping filter-name="resin-profiler" url-pattern="*">
     <dispatcher>REQUEST</dispatcher>
   </filter-mapping>

View results


Profiling Results for /webapp
NameAverage TimeTotal TimeInvocation Count
/foo.jsp
1.7491.7491
/resin-profiler
 0.0000


Profiling sub-requests

Sub-request profiling adds profiling information for pages that are sub-requests of the top level request, typically with <jsp:include>, <jsp:forward>, or the equivalent mechanisms for Servlets.

It imposes a bit more overhead and may be suitable for production servers.

 <web-app ...>
 
   <filter filter-name="resin-profiler"
           filter-class="com.caucho.profiler.ProfilerFilter">
     <init use-query="false"/>
   </filter>
 
   <filter-mapping filter-name="resin-profiler" url-pattern="*">
     <dispatcher>REQUEST</dispatcher>
     <dispatcher>FORWARD</dispatcher>
     <dispatcher>INCLUDE</dispatcher>
     <dispatcher>ERROR</dispatcher>
   </filter-mapping>

View results


Profiling Results for /webapp
NameAverage TimeTotal TimeInvocation Count
/foo.jsp
1.7491.7491
  →/baz.jsp
0.8630.8631
  →/bar.jsp
0.5750.5751
    →/bung.jsp
0.0600.0601
/resin-profiler
 0.0000

JMX

The Profiler instantiates a JMX bean with type `Profiler'.

Personal tools