You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by st...@apache.org on 2004/03/23 20:48:43 UTC
cvs commit: cocoon-2.1/src/blocks/profiler/java/org/apache/cocoon/components/profiler ProfilingCachingProcessingPipeline.java ProfilingNonCachingProcessingPipeline.java
stephan 2004/03/23 11:48:43
Modified: src/blocks/profiler/java/org/apache/cocoon/components/profiler
ProfilingCachingProcessingPipeline.java
ProfilingNonCachingProcessingPipeline.java
Log:
Add support for internal pipelines, see
http://issues.apache.org/bugzilla/show_bug.cgi?id=27875
Revision Changes Path
1.7 +49 -1 cocoon-2.1/src/blocks/profiler/java/org/apache/cocoon/components/profiler/ProfilingCachingProcessingPipeline.java
Index: ProfilingCachingProcessingPipeline.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/profiler/java/org/apache/cocoon/components/profiler/ProfilingCachingProcessingPipeline.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ProfilingCachingProcessingPipeline.java 5 Mar 2004 13:02:20 -0000 1.6
+++ ProfilingCachingProcessingPipeline.java 23 Mar 2004 19:48:43 -0000 1.7
@@ -278,6 +278,54 @@
}
/**
+ * Process the SAX event pipeline
+ */
+ protected boolean processXMLPipeline(Environment environment) throws ProcessingException {
+ this.index = 0;
+ if (this.data!=null) {
+ // Capture environment info
+ this.data.setEnvironmentInfo(new EnvironmentInfo(environment));
+
+ // Execute pipeline
+ long time = System.currentTimeMillis();
+ boolean result = super.processXMLPipeline(environment);
+
+ this.data.setTotalTime(System.currentTimeMillis()-time);
+
+ // Report
+ profiler.addResult(environment.getURI(), this.data);
+ return result;
+ } else {
+ getLogger().warn("Profiler Data havn't any components to measure");
+ return super.processXMLPipeline(environment);
+ }
+ }
+
+ /**
+ * Process the pipeline using a reader.
+ */
+ protected boolean processReader(Environment environment) throws ProcessingException {
+ this.index = 0;
+ if (this.data!=null) {
+ // Capture environment info
+ this.data.setEnvironmentInfo(new EnvironmentInfo(environment));
+
+ // Execute pipeline
+ long time = System.currentTimeMillis();
+ boolean result = super.processReader(environment);
+
+ this.data.setTotalTime(System.currentTimeMillis()-time);
+
+ // Report
+ profiler.addResult(environment.getURI(), this.data);
+ return result;
+ } else {
+ getLogger().warn("Profiler Data havn't any components to measure");
+ return super.processReader(environment);
+ }
+ }
+
+ /**
* Connect the next component
*
* @param environment
1.7 +50 -1 cocoon-2.1/src/blocks/profiler/java/org/apache/cocoon/components/profiler/ProfilingNonCachingProcessingPipeline.java
Index: ProfilingNonCachingProcessingPipeline.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/profiler/java/org/apache/cocoon/components/profiler/ProfilingNonCachingProcessingPipeline.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ProfilingNonCachingProcessingPipeline.java 5 Mar 2004 13:02:20 -0000 1.6
+++ ProfilingNonCachingProcessingPipeline.java 23 Mar 2004 19:48:43 -0000 1.7
@@ -272,6 +272,55 @@
}
/**
+ * Process the SAX event pipeline
+ */
+ protected boolean processXMLPipeline(Environment environment) throws ProcessingException {
+ this.index = 0;
+ if (this.data!=null) {
+ // Capture environment info
+ this.data.setEnvironmentInfo(new EnvironmentInfo(environment));
+
+ // Execute pipeline
+ long time = System.currentTimeMillis();
+ boolean result = super.processXMLPipeline(environment);
+
+ this.data.setTotalTime(System.currentTimeMillis()-time);
+
+ // Report
+ profiler.addResult(environment.getURI(), this.data);
+ return result;
+ } else {
+ getLogger().warn("Profiler Data havn't any components to measure");
+ return super.processXMLPipeline(environment);
+ }
+ }
+
+ /**
+ * Process the pipeline using a reader.
+ */
+ protected boolean processReader(Environment environment) throws ProcessingException {
+ this.index = 0;
+ if (this.data!=null) {
+ // Capture environment info
+ this.data.setEnvironmentInfo(new EnvironmentInfo(environment));
+
+ // Execute pipeline
+ long time = System.currentTimeMillis();
+ boolean result = super.processReader(environment);
+
+ this.data.setTotalTime(System.currentTimeMillis()-time);
+
+ // Report
+ profiler.addResult(environment.getURI(), this.data);
+ return result;
+ } else {
+ getLogger().warn("Profiler Data havn't any components to measure");
+ return super.processReader(environment);
+ }
+ }
+
+
+ /**
* Connect the next component
*
* @param environment