stephan     2002/08/20 09:15:28

  Modified:    src/java/org/apache/cocoon/components/profiler Profiler.java
                        ProfilerData.java ProfilerGenerator.java
                        ProfilerResult.java
                        ProfilingCachingProcessingPipeline.java
                        ProfilingNonCachingProcessingPipeline.java
                        ProfilingSAXBufferConnector.java
                        ProfilingSAXConnector.java SimpleProfiler.java
               src/webapp/WEB-INF cocoon.xconf
  Added:       src/java/org/apache/cocoon/components/profiler
                        ProfilingXMLPipe.java
  Log:
  Made the class, which the profiler used to profile the pipeline
  optional.
  Some cleanup, and some more comments.
  The new class ProfilingSAXBufferConnector should measure the time more
  indepented of the other sitemap components.
  
  Revision  Changes    Path
  1.6       +27 -1     
xml-cocoon2/src/java/org/apache/cocoon/components/profiler/Profiler.java
  
  Index: Profiler.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/profiler/Profiler.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Profiler.java     12 Aug 2002 07:50:53 -0000      1.5
  +++ Profiler.java     20 Aug 2002 16:15:27 -0000      1.6
  @@ -64,12 +64,38 @@
   {
       String ROLE = Profiler.class.getName();
   
  +    /**
  +     * Clear the results.
  +     */
       void clearResults();
  +
  +    /**
  +     * Remove the specified result.
  +     */
       void clearResult(Object key);
   
  +    /**
  +     *
  +     */
       void addResult(String uri, ProfilerData data);
   
  +    /**
  +     *
  +     */
       Collection getResultKeys();
  + 
  +    /**
  +     *
  +     */
       Collection getResults();
  + 
  +    /**
  +     *
  +     */
       ProfilerResult getResult(Object key);
  +
  +    /**
  +     * Create a XMLPipe component to profile the request.
  +     */
  +    public ProfilingXMLPipe createConnector();
   }
  
  
  
  1.7       +36 -9     
xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilerData.java
  
  Index: ProfilerData.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilerData.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ProfilerData.java 27 Jun 2002 10:06:56 -0000      1.6
  +++ ProfilerData.java 20 Aug 2002 16:15:27 -0000      1.7
  @@ -58,6 +58,7 @@
    * Request-time profiler information.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Vadim Gritsenko</a>
  + * @author <a href="mailto:[EMAIL PROTECTED]";>Stephan Michels</a>
    * @version CVS $Id$
    */
   public class ProfilerData
  @@ -79,29 +80,40 @@
   
       private ArrayList a = null;
   
  +    private long totaltime = 0;
  +
       public ProfilerData()
       {
           a = new ArrayList();
           a.add(null);
       }
   
  -    public void setGenerator(Object generator, String role, String source)
  -    {
  +    public void setGenerator(Object generator, String role, String source) {
           a.set(0, new Entry(generator, role, source));
       }
   
  -    public void addComponent(Object component, String role, String source)
  -    {
  +    public void addComponent(Object component, String role, String source) {
           a.add(new Entry(component, role, source));
       }
   
  -    public void setTime(int i, long time)
  -    {
  +    /**
  +     * Set measured time of the i-th component of the pipeline.
  +     */
  +    public void setTime(int i, long time) {
           ((Entry)a.get(i)).time = time;
       }
   
  -    Entry[] getEntries()
  -    {
  +    /**
  +     * Get measured time of the i-th component of the pipeline.
  +     */
  +    public long setTime(int i) {
  +        return ((Entry)a.get(i)).time;
  +    }
  +
  +    /**
  +     * Returns all measured times.
  +     */
  +    public Entry[] getEntries() {
           return (Entry[])a.toArray(new Entry[a.size()]);
       }
   
  @@ -117,6 +129,21 @@
           }
           return HashUtil.hash(key);
       }
  +
  +    /**
  +     * Set measured time of precessing from the pipeline.
  +     */
  +    public void setTotalTime(long time) {
  +        this.totaltime = time;
  +    }
  +
  +    /**
  +     * Return measured time of precessing from the pipeline.
  +     */
  +    public long getTotalTime() {
  +        return this.totaltime;
  +    }
  +
   /*
       public void report(String uri)
       {
  
  
  
  1.7       +35 -33    
xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilerGenerator.java
  
  Index: ProfilerGenerator.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilerGenerator.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ProfilerGenerator.java    27 Jun 2002 10:06:56 -0000      1.6
  +++ ProfilerGenerator.java    20 Aug 2002 16:15:27 -0000      1.7
  @@ -66,10 +66,10 @@
    * Generates an XML representation of the current status of Profiler.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Vadim Gritsenko</a>
  + * @author <a href="mailto:[EMAIL PROTECTED]";>Stephan Michels</a>
    * @version CVS $Id$
    */
  -public class ProfilerGenerator
  -extends ComposerGenerator {
  +public class ProfilerGenerator extends ComposerGenerator {
   
       /**
        * The XML namespace for the output document.
  @@ -139,58 +139,60 @@
           AttributesImpl atts = new AttributesImpl();
   
           int count = result.getCount();
  -        String[] roles = result.getRoles();
  -        String[] source = result.getSources();
  -        long[] avgTime = result.getTotalTime();
  -        long avgTotal = 0;
  -        for(int i=0; i < avgTime.length; i++)
  -            avgTotal += avgTime[i];
  +        String[] roles = result.getRoles(); // Roles of the components
  +        String[] source = result.getSources(); // Source of the components
  +        long[] totalTime = result.getTotalTime(); // Total time of the requests
  +        long totalTimeSum = 0; // Total time of all requests
  +        for(int i=0; i < count; i++)
  +            totalTimeSum += totalTime[i];
   
           atts.addAttribute(namespace, "uri", "uri", "CDATA", result.getURI());
           atts.addAttribute(namespace, "count", "count", "CDATA", 
Integer.toString(result.getCount()));
  -        atts.addAttribute(namespace, "time", "time", "CDATA", 
Long.toString(avgTotal));
  +        atts.addAttribute(namespace, "time", "time", "CDATA", 
Long.toString(totalTimeSum));
           ch.startElement(namespace, "pipeline", "pipeline", atts);
           atts.clear();
   
           if(count > 0){
  -            atts.addAttribute(namespace, "time", "time", "CDATA", 
Long.toString(avgTotal / count));
  +            atts.addAttribute(namespace, "time", "time", "CDATA", 
Long.toString(totalTimeSum / count));
               ch.startElement(namespace, "average", "average", atts);
               atts.clear();
  +
  +            long[][] timeOfComponents = result.getLastTimes(); // Time of each 
component
  +            long[] totalTimeOfComponents = new long[roles.length]; // Time of each 
component for all requests
  +          
  +            for(int j=0; j<count; j++){
  +                for(int i=0; i<roles.length; i++){
  +                    totalTimeOfComponents[i] += timeOfComponents[j][i];
  +                }
  +            }
  +
               for(int i=0; i<roles.length; i++){
                   if(roles[i] != null)
                       atts.addAttribute(namespace, "role", "role", "CDATA", roles[i]);
                   if(source[i] != null)
                       atts.addAttribute(namespace, "source", "source", "CDATA", 
source[i]);
  -                atts.addAttribute(namespace, "time", "time", "CDATA", 
Long.toString(avgTime[i] / count));
  +                atts.addAttribute(namespace, "time", "time", "CDATA", 
Long.toString(totalTimeOfComponents[i] / count));
                   ch.startElement(namespace, "element", "element", atts);
                   atts.clear();
                   ch.endElement(namespace, "element", "element");
               }
               ch.endElement(namespace, "average", "average");
   
  -            long[][] last = result.getLastTimes();
  -            for(int j=0; j<last.length; j++){
  -                if(last[j] != null){
  -                    long[] curTime = last[j];
  -                    long curTotal = 0;
  -                    for(int i=0; i < curTime.length; i++)
  -                        curTotal += curTime[i];
  -
  -                    atts.addAttribute(namespace, "time", "time", "CDATA", 
Long.toString(curTotal));
  -                    ch.startElement(namespace, "result", "result", atts);
  +            for(int j=0; j<count; j++){
  +                atts.addAttribute(namespace, "time", "time", "CDATA", 
Long.toString(totalTime[j]));
  +                ch.startElement(namespace, "result", "result", atts);
  +                atts.clear();
  +                for(int i=0; i<roles.length; i++){
  +                    if(roles[i] != null)
  +                        atts.addAttribute(namespace, "role", "role", "CDATA", 
roles[i]);
  +                    if(source[i] != null)
  +                        atts.addAttribute(namespace, "source", "source", "CDATA", 
source[i]);
  +                    atts.addAttribute(namespace, "time", "time", "CDATA", 
Long.toString(timeOfComponents[j][i]));
  +                    ch.startElement(namespace, "element", "element", atts);
                       atts.clear();
  -                    for(int i=0; i<roles.length; i++){
  -                        if(roles[i] != null)
  -                            atts.addAttribute(namespace, "role", "role", "CDATA", 
roles[i]);
  -                        if(source[i] != null)
  -                            atts.addAttribute(namespace, "source", "source", 
"CDATA", source[i]);
  -                        atts.addAttribute(namespace, "time", "time", "CDATA", 
Long.toString(curTime[i]));
  -                        ch.startElement(namespace, "element", "element", atts);
  -                        atts.clear();
  -                        ch.endElement(namespace, "element", "element");
  -                    }
  -                    ch.endElement(namespace, "result", "result");
  +                    ch.endElement(namespace, "element", "element");
                   }
  +                ch.endElement(namespace, "result", "result");
               }
           }
   
  
  
  
  1.5       +46 -23    
xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilerResult.java
  
  Index: ProfilerResult.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilerResult.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ProfilerResult.java       22 Feb 2002 07:00:11 -0000      1.4
  +++ ProfilerResult.java       20 Aug 2002 16:15:27 -0000      1.5
  @@ -61,28 +61,41 @@
   public class ProfilerResult
   {
       private String uri;
  +
  +    // Roles of the sitemap components
       private String[] roles;
  +
  +    // Sources of the sitemap components
       private String[] sources;
   
  -    private int count;
  +    // Count of the ProfilerData entries
  +    private int count = 0;
  +
  +    // Total times of each request
       private long[] totalTime;
  +
  +    // Times of each component of the latest n-requests
       private long[][] latestTimes;
  -    private int latestCurrent;
  +
  +    // Which row of 'latestTimes' are lastest 
  +    private int latestCurrent = 0;
   
       public ProfilerResult(String uri, int latestResultsCount)
       {
           this.uri = uri;
  -        if(latestResultsCount > 0)
  -            this.latestTimes = new long[latestResultsCount][];
  +        this.latestTimes = new long[(latestResultsCount>0)?latestResultsCount:5][];
  +        this.totalTime = new long[(latestResultsCount>0)?latestResultsCount:5];
       }
   
  +    /**
  +     * Add a new profiler data from a request to the result.
  +     */
       public void addData(ProfilerData data)
       {
           ProfilerData.Entry[] entries = data.getEntries();
           synchronized(this){
  -            if(totalTime == null || totalTime.length != entries.length){
  +            if(roles == null || roles.length != entries.length){
                   // Reinitialize arrays
  -                totalTime = new long[entries.length];
                   roles = new String[entries.length];
                   sources = new String[entries.length];
                   for(int i=0; i<entries.length; i++){
  @@ -92,63 +105,74 @@
                       sources[i] = entries[i].source;
                   }
   
  -                // Clear latest times
  -                if(latestTimes != null)
  -                    Arrays.fill(latestTimes, 0, latestTimes.length, null);
  -                latestCurrent = 0;
  -
                   // Clear counter
                   count = 0;
               }
   
  -            // Adjust time. It's cumulative towards 0 index in data object
  -            for(int i=0; i<entries.length-1; i++)
  -                entries[i].time -= entries[i+1].time;
  -
               long[] latest = new long[entries.length];
               for(int i=0; i<entries.length; i++)
  -                totalTime[i] += latest[i] = entries[i].time;
  +                latest[i] = entries[i].time;
   
               if(latestTimes != null){
  -                latestTimes[latestCurrent++] = latest;
  +                latestTimes[latestCurrent] = latest;
  +                totalTime[latestCurrent++]  = data.getTotalTime();
                   if(latestCurrent >= latestTimes.length) latestCurrent = 0;
               }
   
  -            count++;
  +            if (count<latestTimes.length)
  +                count++;
           }
       }
   
  +    /**
  +     * The URI of the request.
  +     */
       public String getURI()
       {
           return uri;
       }
   
  +    /**
  +     * Roles of the sitemap components.
  +     */
       public String[] getRoles()
       {
           return roles;
       }
   
  +    /**
  +     * Sources of the sitemap components.
  +     */
       public String[] getSources()
       {
           return sources;
       }
   
  +    /**
  +     * Count of the ProfilerData entries
  +     */
       public int getCount()
       {
           return count;
       }
   
  +    /**
  +     * Total times of each request.
  +     */
       public long[] getTotalTime()
       {
           return totalTime;
       }
   
  +    /**
  +     * Times of each component of the latest n-requests
  +     */
       public long[][] getLastTimes()
       {
           return latestTimes;
       }
  -/*
  -    public void report()
  +
  +/*    public void report()
       {
           
System.err.println("-------------------------------------------------------------------------------");
           System.err.println("PROFILER TOTALS FOR: " + uri);
  @@ -162,6 +186,5 @@
               System.err.println("PROFILER TOTALS: " + time + " TIMES");
               System.err.println("PROFILER TOTALS: " + count + " REQUESTS");
           }
  -    }
  -*/
  +    }*/
   }
  
  
  
  1.4       +5 -4      
xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilingCachingProcessingPipeline.java
  
  Index: ProfilingCachingProcessingPipeline.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilingCachingProcessingPipeline.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ProfilingCachingProcessingPipeline.java   27 Jun 2002 10:06:56 -0000      1.3
  +++ ProfilingCachingProcessingPipeline.java   20 Aug 2002 16:15:27 -0000      1.4
  @@ -130,7 +130,7 @@
               // Execute pipeline
               long time = System.currentTimeMillis();
               boolean result = super.process(environment);
  -            this.data.setTime(0, System.currentTimeMillis() - time);
  +            this.data.setTotalTime(System.currentTimeMillis() - time);
   
               // Report
               profiler.addResult(environment.getURI(), data);
  @@ -139,7 +139,8 @@
               this.data = new ProfilerData();
               long time = System.currentTimeMillis();
               boolean result = super.process( environment );
  -            this.data.setTime(0, System.currentTimeMillis() - time);
  +            this.data.setTotalTime(System.currentTimeMillis() - time);
  +
               // Report
               profiler.addResult(environment.getURI(), data);
               return result;
  @@ -153,7 +154,7 @@
                              XMLProducer producer,
                              XMLConsumer consumer)
       throws ProcessingException {
  -        ProfilingSAXConnector connector = new ProfilingSAXConnector();
  +        ProfilingXMLPipe connector = this.profiler.createConnector();
           connector.setup(this.index, this.data);
           this.index++;
           super.connect(environment, producer, connector);
  
  
  
  1.4       +5 -4      
xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilingNonCachingProcessingPipeline.java
  
  Index: ProfilingNonCachingProcessingPipeline.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilingNonCachingProcessingPipeline.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ProfilingNonCachingProcessingPipeline.java        27 Jun 2002 10:06:56 -0000     
 1.3
  +++ ProfilingNonCachingProcessingPipeline.java        20 Aug 2002 16:15:27 -0000     
 1.4
  @@ -130,7 +130,7 @@
               // Execute pipeline
               long time = System.currentTimeMillis();
               boolean result = super.process(environment);
  -            this.data.setTime(0, System.currentTimeMillis() - time);
  +            this.data.setTotalTime(System.currentTimeMillis() - time);
   
               // Report
               profiler.addResult(environment.getURI(), data);
  @@ -139,7 +139,8 @@
               this.data = new ProfilerData();
               long time = System.currentTimeMillis();
               boolean result = super.process( environment );
  -            this.data.setTime(0, System.currentTimeMillis() - time);
  +            this.data.setTotalTime(System.currentTimeMillis() - time);
  +
               // Report
               profiler.addResult(environment.getURI(), data);
               return result;
  @@ -153,7 +154,7 @@
                              XMLProducer producer,
                              XMLConsumer consumer)
       throws ProcessingException {
  -        ProfilingSAXConnector connector = new ProfilingSAXConnector();
  +        ProfilingSAXBufferConnector connector = new ProfilingSAXBufferConnector();
           connector.setup(this.index, this.data);
           this.index++;
           super.connect(environment, producer, connector);
  
  
  
  1.2       +2 -2      
xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilingSAXBufferConnector.java
  
  Index: ProfilingSAXBufferConnector.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilingSAXBufferConnector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ProfilingSAXBufferConnector.java  20 Aug 2002 13:46:25 -0000      1.1
  +++ ProfilingSAXBufferConnector.java  20 Aug 2002 16:15:27 -0000      1.2
  @@ -68,7 +68,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stephan Michels</a>
    * @version CVS $Id$
    */
  -public class ProfilingSAXBufferConnector implements XMLPipe {
  +public class ProfilingSAXBufferConnector implements ProfilingXMLPipe {
   
       private XMLConsumer consumer;
   
  
  
  
  1.7       +7 -3      
xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilingSAXConnector.java
  
  Index: ProfilingSAXConnector.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilingSAXConnector.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ProfilingSAXConnector.java        27 Jun 2002 10:06:56 -0000      1.6
  +++ ProfilingSAXConnector.java        20 Aug 2002 16:15:27 -0000      1.7
  @@ -59,7 +59,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Vadim Gritsenko</a>
    * @version CVS $Id$
    */
  -public class ProfilingSAXConnector extends AbstractXMLPipe {
  +public class ProfilingSAXConnector extends AbstractXMLPipe implements 
ProfilingXMLPipe {
       private ProfilerData data;
       private int index;
       private long time;
  @@ -83,8 +83,12 @@
           time = System.currentTimeMillis();
           super.endDocument();
           total += System.currentTimeMillis() - time;
  -        if(index != -1)
  +
  +        if(index != -1) {
               data.setTime(index, total);
  +            if (index>1)
  +                data.setTime(index-1, data.setTime(index-1)-total);
  +        }
       }
   
       public void startPrefixMapping(String prefix, String uri)
  
  
  
  1.6       +53 -6     
xml-cocoon2/src/java/org/apache/cocoon/components/profiler/SimpleProfiler.java
  
  Index: SimpleProfiler.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/profiler/SimpleProfiler.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SimpleProfiler.java       31 Jul 2002 13:13:24 -0000      1.5
  +++ SimpleProfiler.java       20 Aug 2002 16:15:27 -0000      1.6
  @@ -50,9 +50,14 @@
   */
   package org.apache.cocoon.components.profiler;
   
  +import org.apache.avalon.framework.configuration.Configuration;
  +import org.apache.avalon.framework.configuration.ConfigurationException;
  +import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.thread.ThreadSafe;
   
  +import org.apache.cocoon.xml.XMLPipe;
  +
   import java.util.Collection;
   import java.util.HashMap;
   import java.util.Map;
  @@ -62,24 +67,52 @@
    * all pipelines.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Vadim Gritsenko</a>
  + * @author <a href="mailto:[EMAIL PROTECTED]";>Stephan Michels</a>
    * @version CVS $Id$
    */
   public class SimpleProfiler extends AbstractLogEnabled
  -    implements Profiler, ThreadSafe //, Composable, Configurable, Disposable
  -{
  -    private static final int RESULTS_COUNT = 10;
  +    implements Profiler, ThreadSafe, Configurable {
  +
  +    // Maximal count of entries, which should be stored.
  +    private int results_count = 10;
  +
       private Map results;
   
  +    // Class name for the ProfilingXMLPipe
  +    private String connectorclass = 
  +        "org.apache.cocoon.components.profiler.ProfilingSAXBufferConnector";
  +
       public SimpleProfiler()
       {
           results = new HashMap();
       }
   
  +    /**
  +     * Pass the Configuration to the Configurable class. This method must 
  +     * always be called after the constructor and before any other method.
  +     * 
  +     * @param configuration the class configurations.
  +     */
  +    public void configure(Configuration configuration)
  +        throws ConfigurationException {
  +
  +        this.connectorclass = 
configuration.getChild("connector").getAttribute("class",
  +            "org.apache.cocoon.components.profiler.ProfilingSAXBufferConnector");
  +
  +        this.results_count = configuration.getAttributeAsInteger("results", 10);
  +    }
  +
  +    /**
  +     * Clear the results.
  +     */
       public void clearResults()
       {
           results.clear();
       }
   
  +    /**
  +     * Remove the specified result.
  +     */
       public void clearResult(Object key)
       {
           results.remove(key);
  @@ -107,11 +140,25 @@
           if(result == null){
               synchronized(results){
                   if((result = (ProfilerResult)results.get(key)) == null)
  -                    results.put(key, result = new ProfilerResult(uri, 
RESULTS_COUNT));
  +                    results.put(key, result = new ProfilerResult(uri, 
results_count));
               }
           }
   
           result.addData(data);
  -//           result.report();
  +    }
  +
  +    /**
  +     * Create a XMLPipe component to profile the request.
  +     */
  +    public ProfilingXMLPipe createConnector() {
  +        ProfilingXMLPipe conector;
  +        try {
  +            conector = 
(ProfilingXMLPipe)Class.forName(this.connectorclass).newInstance();
  +        } catch (Exception e) {
  +            getLogger().warn("Could not load class '"+this.connectorclass+"'", e);
  +
  +            conector = new 
org.apache.cocoon.components.profiler.ProfilingSAXBufferConnector();
  +        }
  +        return conector;
       }
   }
  
  
  
  1.1                  
xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilingXMLPipe.java
  
  Index: ProfilingXMLPipe.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      [EMAIL PROTECTED]
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <[EMAIL PROTECTED]>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.profiler;
  
  import org.apache.cocoon.xml.XMLPipe;
  
  /**
   * This interface glues together an XML producer and consumer to create a
   * SAX pipe. This class make possible to profile. 
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>Stephan Michels</a>
   * @version CVS $Id: ProfilingXMLPipe.java,v 1.1 2002/08/20 16:15:27 stephan Exp $
   */
  public interface ProfilingXMLPipe extends XMLPipe {
  
      /**
       * Setup this SAXPipe for profiling.
       */
      public void setup(int index, ProfilerData data);
  }
  
  
  
  1.36      +5 -3      xml-cocoon2/src/webapp/WEB-INF/cocoon.xconf
  
  Index: cocoon.xconf
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/WEB-INF/cocoon.xconf,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- cocoon.xconf      13 Aug 2002 14:04:15 -0000      1.35
  +++ cocoon.xconf      20 Aug 2002 16:15:27 -0000      1.36
  @@ -436,8 +436,10 @@
       which are used to generate the profile report. You need to enable all of
       these components to use profiler.
   
  -    Uncomment the following line to use profiler.
  -  <profiler/>
  +    Uncomment the following lines to use profiler.
  +  <profiler results="10">
  +    <connector 
class="org.apache.cocoon.components.profiler.ProfilingSAXBufferConnector"/>
  +  </profiler>
     -->
   
     <!-- Resource Monitor:
  @@ -626,4 +628,4 @@
     <continuations time-to-live="3600"/>
   
   
  -</cocoon>
  \ No newline at end of file
  +</cocoon>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to