Profile Generator
The profile generator creates xml from the current profiler
measurement
results of cocoon.
The information is surrounded by the root element
profilerinfo
and grouped with the elements pipeline ,
average , result and
element .
The profilerinfo element has the attribute
date .
The pipeline element has the attributes
uri , count and time .
The average element has the attribute
time .
The element element has the attributes
role , source and time .
A pipeline summarizes profile information of a
pipeline
as specified in the sitemap .
Each pipeline element consists of
an average , and a result element.
The average element describes the average time
values,
whereas the result element describes each pipeline
processing.
The element element describes the timing values
for each stage of
the pipeline processing.
All elements have the namespace
http://apache.org/cocoon/profiler/1.0 .
-
Name : profile
-
Class:
org.apache.cocoon.components.profiler.ProfilerGenerator
-
Cacheable: no.
Configuraton of cocoon.xconf
Edit cocoon.xconf
 |  |  |
 |
...
<event-pipeline class="org.apache.cocoon.components.profiler.\
ProfilingNonCachingEventPipeline"/>
<sax-connector class="org.apache.cocoon.components.profiler.\
ProfilingSAXConnector"/>
...
<profiler/>
|  |
 |  |  |
Configuration sitemap.xmap
Edit sitemap.xmap
 |  |  |
 |
<map:generators default="file">
...
<map:generator name="profile"
src="org.apache.cocoon.components.profiler.ProfilerGenerator"
label="content"/>
</map:generators> ...
<map:match pattern="profile">
<map:generate type="profile"/>
<map:transform type="xslt" src="stylesheets/system/profile2html.xsl"/>
<map:serialize/>
</map:match>
|  |
 |  |  |
You may try http://localhost/cocoon/profile
several times.
Configuration
The following parameter can be specified in the pipeline for
the generate command:
-
sort (optional) : Sets how Profile Generator sorts
pipeline elements. You may set
sort to
uri
to sort pipeline element by its uri
attribute,
setting sort to time sorts
pipeline elements by its time
attribute,
finally setting sort to count sorts
pipeline elements
by its count attribute.
DTD
XML generated by status generator uses namespace
http://apache.org/cocoon/status/2.0 . The DTD of XML
generated by status generator:
 |  |  |
 |
<!ELEMENT profilerinfo (pipeline)*>
<!ATTLIST profilerinfo
date CDATA #IMPLIED
>
<!ELEMENT pipeline (average, result)*>
<!ATTLIST pipeline
uri CDATA #REQUIRED
count CDATA #REQUIRED
time CDATA #REQUIRED
>
<!ELEMENT average (element)*>
<!ATTLIST average
time CDATA #REQUIRED
>
<!ELEMENT result (element)*>
<!ATTLIST result
time CDATA #REQUIRED
>
<!ELEMENT element EMPTY>
<!ATTLIST element
role CDATA #REQUIRED
source CDATA #IMPLIED
time CDATA #REQUIRED
>
|  |
 |  |  |
Example
The profile generator may output information:
 |  |  |
 |
<profilerinfo xmlns="http://apache.org/cocoon/profiler/1.0"
date="01.09.2001 21:50:00">
<pipeline uri="welcome" count="1" time="481">
<average time="481">
<element role="file" source="docs/samples/samples.xml"
time="250"/>
<element role="xslt" source="stylesheets/simple-samples2html.xsl"
time="171"/>
<element role="org.apache.cocoon.serialization.HTMLSerializer"
time="60"/>
</average>
<result time="481">
<element role="file" source="docs/samples/samples.xml"
time="250"/>
<element role="xslt" source="stylesheets/simple-samples2html.xsl"
time="171"/>
<element role="org.apache.cocoon.serialization.HTMLSerializer"
time="60"/>
</result>
</pipeline>
<pipeline uri="profile" count="1" time="3355">
<average time="3355">
<element role="profile" time="2964"/>
<element role="xslt" source="stylesheets/system/profile2html.xsl"
time="180"/>
<element role="org.apache.cocoon.serialization.HTMLSerializer"
time="211"/>
</average>
<result time="3355">
<element role="profile" time="2964"/>
<element role="xslt" source="stylesheets/system/profile2html.xsl"
time="180"/>
<element role="org.apache.cocoon.serialization.HTMLSerializer"
time="211"/>
</result>
</pipeline>
</profilerinfo>
|  |
 |  |  |
|