apache > cocoon

Profile Generator

Profile Generator

The profile generator creates xml from the current profiler measurement results of cocoon.

If you just want to use the Cocoon profiler, look at this document.

  • Name : profile
  • Class: org.apache.cocoon.components.profiler.ProfilerGenerator
  • Cacheable: no

When no parameters are specified, the profiler generator will simply generate all available information. Here is some example output:

<profilerinfo date="Mar 24, 2003 5:10:56 PM" xmlns="http://apache.org/cocoon/profiler/1.0">
  <pipeline count="2" key="4704447257427244431" processingTime="378" uri="caching-testsite.html">
    <average time="189">
      <component offset="0" role="file" source="test.xml" time="1"/>
      <component offset="1" role="xslt" source="test2page.xsl" time="58"/>
      <component offset="2" role="xslt" source="page2html.xsl" time="115"/>
      <component offset="3" role="html" time="2"/>
    <result index="0" time="128">
      <component index="0" processing="0" role="file" setup="0"
        source="test.xml" time="0"/>
      <component index="1" processing="0" role="xslt" setup="59"
        source="test2page.xsl" time="59"/>
      <component index="2" processing="0" role="xslt" setup="65"
        source="page2html.xsl" time="65"/>
      <component index="3" processing="0" role="html" setup="0" time="0"/>
    <result index="1" time="250">
      <component index="0" processing="1" role="file" setup="1"
        source="test.xml" time="2"/>
      <component index="1" processing="1" role="xslt" setup="56"
        source="test2page.xsl" time="57"/>
      <component index="2" processing="21" role="xslt" setup="145"
        source="page2html.xsl" time="166"/>
      <component index="3" processing="5" role="html" setup="0" time="5"/>
  <pipeline count="1" key="-1812911851413592444" processingTime="190" uri="noncaching-testsite.html">
    <average time="190">
      <component offset="0" role="file" source="test.xml" time="1"/>
      <component offset="1" role="xslt" source="test2page.xsl" time="86"/>
      <component offset="2" role="xslt" source="page2html.xsl" time="70"/>
      <component offset="3" role="html" time="19"/>
    <result index="0" time="190">
      <component index="0" processing="1" role="file" setup="0"
        source="test.xml" time="1"/>
      <component index="1" processing="3" role="xslt" setup="83"
        source="test2page.xsl" time="86"/>
      <component index="2" processing="7" role="xslt" setup="63"
        source="page2html.xsl" time="70"/>
      <component index="3" processing="19" role="html" setup="0" time="19"/>

The output consists of a profilerinfo element containing a number of pipeline elements. Each pipeline is identified by a key. The pipeline element contains one average element (containing the average results) and one or more result elements for the individual results (by default only the last 10 results are remembered). Each result element contains a number of component elements, one for each component (generator, transformer, serializer) in the pipeline.

All elements have the namespace http://apache.org/cocoon/profiler/1.0.

On the component element, there are three attributes indicating timings:

  • setup: time spent in the component's setup method
  • processing: time spent processing the SAX events
  • time: sum of the processing and setup times

The output of the profiler generator can be tuned using the following request parameters:

  • key: limit the output to the pipeline with this key
  • result: to be used in combination with key, causes only the result with this index to be included. In this case some additional information about the environment (request parameters and session attributes) will be returned.
  • component: to be used in combination with key and result. When this parameter is specified, the XML that was generated by the component with this index will be included in the output (as child of the specified component element).
  • fragmentonly: to be used in combination with key, result and component. If this parameter is true, only the XML that was generated by the specified component will be returned, without additional profiler information around it.