A document has been updated:
http://cocoon.zones.apache.org/daisy/legacydocs/569.html
Document ID: 569
Branch: main
Language: default
Name: Cocoon Profiler (unchanged)
Document Type: Cocoon Document (unchanged)
Updated on: 1/10/07 4:39:17 AM
Updated by: Lars Huttar
A new version has been created, state: draft
Parts
=====
Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name: (unchanged)
Size: 6746 bytes (previous version: 4961 bytes)
Content diff:
(30 equal lines skipped)
<p>To use the profiler, two things need to be done:</p>
<ul>
--- <li>Change the pipeline implementation</li>
--- <li>Add pipelines to generate the profiler information</li>
+++ <li>Configure profiling pipeline implementations</li>
+++ <li>Add matchers to generate the profiler information</li>
</ul>
<h2>Change pipeline implementation</h2>
<p>First, check that the profiling pipeline implementations (caching and/or
--- noncaching) are declared in the map:components section of the sitemap. Here
is
--- an example:</p>
+++ noncaching) are declared in the map:components section of the sitemap. (As
of
+++ Cocoon 2.1.7 at least, they are already declared in the top-level sitemap
so you
+++ may not have to worry about it.) Here is an example:</p>
<pre><map:pipes default="caching">
[...]
(8 equal lines skipped)
<p>You can now turn on the profiling in two ways:</p>
<ul>
--- <li>Change the default pipeline implementation by changing the value of the
--- default attribute on the map:pipes element.</li>
+++ <li>Change the default pipeline type by changing the value of the default
+++ attribute on the map:pipes element.</li>
<li>Change the pipeline implementation of a specific map:pipeline by adding
a
type attribute to it with as value "profile-caching" or
"profiling-noncaching".
</li>
</ul>
--- <h2>Add pipelines to generate the profiler information</h2>
+++ <h2>Add matchers to generate the profiler information</h2>
<p class="note">Instead of following the instructions below, you could also
reuse the profiler demonstration from the Cocoon samples as-is, and mount it
(22 equal lines skipped)
<map:serialize type="xml"/>
</map:match></pre>
--- <p>Make sure the profile2html.xsl stylesheet is available, you can find it
in te
--- Cocoon distribution.</p>
+++ <p>Make sure the profile2html.xsl stylesheet is available; you can find it
in
+++ the Cocoon distribution under samples/blocks/profiler/. (Or use
+++ <tt>src="context://samples/blocks/profiler/profile2page.xsl"</tt>.)</p>
+++ <p>Note that the <a href="../profile-generator.html">profile generator</a>
will
+++ generate somewhat different information depending on the presence of request
+++ parameters (see below for info).</p>
+++
<p>You also need the pretty-content view (which is included in the default
Cocoon sitemap). It can be added in the map:views section of the sitemap as
follows:</p>
(10 equal lines skipped)
<p>Now you are ready to use the profiler. First make a series of requests
on the
pages you want to profile, then go look at the profiler results by
requesting
--- the profile.html page.</p>
+++ the profile.html page. (This can be easily seen by visiting the profiler
sample
+++ block, at <tt>http://localhost/samples/blocks/profiler/profile.html</tt>.
Adjust
+++ to suit your installation.) You can add the <tt>cocoon-view=content</tt>
+++ request parameter to see the raw XML output.</p>
+++ <ul>
+++ <li><tt>profile.html</tt>: generate a report of all pipelines profiled so
far;
+++ and for each one, report its average processing time and the processing
time for
+++ each run. Includes a unique generated key for each pipeline, as well as its
URI.
+++ The raw XML output, viewable with <tt>profile.html?cocoon-view=content</tt>,
+++ includes information on each component in each pipeline, such as the
component
+++ type ("role"), source, and processing times.</li>
+++ <li><tt>profile.html?key=7547...</tt>: Narrow the above report to a
specific
+++ URI (pipeline) with the given key.</li>
+++ <li><tt>profile.html?key=7547...&result=n</tt>: generate a report for
the
+++ nth run of the specified pipeline. Then you can click on a component to see
its
+++ XML output:</li>
+++ <li><tt>profile.html?key=7547...&result=n&component=c</tt>:
generate a
+++ report for the specified component, including its XML output.</li>
+++ </ul>
+++
+++ <p>For more details about the request parameters taken by the profile
generator,
+++ and its XML output, see <a href="../profile-generator.html">profile
+++ generator</a>.</p>
+++
<h1>Notes</h1>
<ul>
--- <li>the profiler is contained in a seperate Cocoon block. Unless you
deactivated
--- it, it is included in the standard build.</li>
--- <li>if you are streaming very large documents through the pipeline, the
profiler
+++ <li>The profiler is contained in a seperate Cocoon block,
+++ <tt>samples/blocks/profiler</tt>. Unless you have deactivated it, it is
included
+++ in the standard build.</li>
+++ <li>If you are streaming very large documents through the pipeline, the
profiler
will use a lot of memory since it buffers the data in between pipeline
components.</li>
--- <li>profiling has a very negative impact on performance and memory usage,
since
+++ <li>Profiling has a very negative impact on performance and memory usage,
since
it buffers all data between pipeline components. Only activate it when
required,
and never activate it on production systems.</li>
--- <li>when using the profile-caching pipeline implementation the XML
generated by
+++ <li>When using the profile-caching pipeline implementation the XML
generated by
components will only be available on non-cached executions.</li>
</ul>
(2 equal lines skipped)