teiid SVN: r4593 - in branches/7.7.x/engine/src: test/java/org/teiid/query/processor/relational and 1 other directory.
by teiid-commits@lists.jboss.org
Author: jolee
Date: 2013-08-27 08:31:52 -0400 (Tue, 27 Aug 2013)
New Revision: 4593
Modified:
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeStatistics.java
branches/7.7.x/engine/src/test/java/org/teiid/query/processor/relational/TestRelationalNodeStatistics.java
Log:
BZ975033: EDS_5.3.1_3_2013 + TEIID-2475: The RelationalNode.collectNodeStats is only subtracting out the last node (reprise)
Modified: branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java 2013-08-22 14:43:08 UTC (rev 4592)
+++ branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java 2013-08-27 12:31:52 UTC (rev 4593)
@@ -289,6 +289,7 @@
}
}
this.recordBatch(batch);
+ recordStats = false;
}
//24663: only return non-zero batches.
//there have been several instances in the code that have not correctly accounted for non-terminal zero length batches
Modified: branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeStatistics.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeStatistics.java 2013-08-22 14:43:08 UTC (rev 4592)
+++ branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeStatistics.java 2013-08-27 12:31:52 UTC (rev 4593)
@@ -52,7 +52,7 @@
private long batchEndTime;
// The processing time for the node (does not include child processing)
- private long nodeProcessingTime;
+ private long nodeNextBatchProcessingTime;
// the total processing time for the node (indcludes child processing (lastEndTime - firstStartTime)
private long nodeCumulativeProcessingTime;
@@ -107,21 +107,21 @@
// set nodeEndTime to the time gathered at the end of the last batch
this.nodeEndTime = this.batchEndTime;
this.nodeCumulativeProcessingTime = this.nodeEndTime - this.nodeStartTime;
- this.nodeProcessingTime = this.nodeCumulativeProcessingTime;
+ this.nodeNextBatchProcessingTime = this.nodeCumulativeProcessingTime;
for (int i = 0; i < relationalNodes.length; i++) {
if (relationalNodes[i] == null) {
break;
}
- this.nodeProcessingTime -= relationalNodes[i].getNodeStatistics().getNodeCumulativeProcessingTime();
+ this.nodeNextBatchProcessingTime -= relationalNodes[i].getNodeStatistics().getNodeCumulativeNextBatchProcessingTime();
}
}
public List<String> getStatisticsList() {
ArrayList<String> statisticsList = new ArrayList<String>(6);
statisticsList.add("Node Output Rows: " + this.nodeOutputRows); //$NON-NLS-1$
- statisticsList.add("Node Process Time: " + this.nodeProcessingTime); //$NON-NLS-1$
+ statisticsList.add("Node Next Batch Process Time: " + this.nodeNextBatchProcessingTime); //$NON-NLS-1$
+ statisticsList.add("Node Cumulative Next Batch Process Time: " + this.nodeCumulativeNextBatchProcessingTime); //$NON-NLS-1$
statisticsList.add("Node Cumulative Process Time: " + this.nodeCumulativeProcessingTime); //$NON-NLS-1$
- statisticsList.add("Node Cumulative Next Batch Process Time: " + this.nodeCumulativeNextBatchProcessingTime); //$NON-NLS-1$
statisticsList.add("Node Next Batch Calls: " + this.nodeNextBatchCalls); //$NON-NLS-1$
statisticsList.add("Node Blocks: " + this.nodeBlocks); //$NON-NLS-1$
return statisticsList;
@@ -170,12 +170,12 @@
return this.nodeOutputRows;
}
/**
- * @return Returns the nodeProcessingTime.
+ * @return Returns the nodeNextBatchProcessingTime.
* @since 4.2
*/
- public long getNodeProcessingTime() {
- return this.nodeProcessingTime;
- }
+ public long getNodeNextBatchProcessingTime() {
+ return this.nodeNextBatchProcessingTime;
+ }
/**
* @return Returns the nodeStartTime.
* @since 4.2
Modified: branches/7.7.x/engine/src/test/java/org/teiid/query/processor/relational/TestRelationalNodeStatistics.java
===================================================================
--- branches/7.7.x/engine/src/test/java/org/teiid/query/processor/relational/TestRelationalNodeStatistics.java 2013-08-22 14:43:08 UTC (rev 4592)
+++ branches/7.7.x/engine/src/test/java/org/teiid/query/processor/relational/TestRelationalNodeStatistics.java 2013-08-27 12:31:52 UTC (rev 4593)
@@ -25,6 +25,7 @@
import static org.junit.Assert.*;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import org.junit.Test;
@@ -73,14 +74,16 @@
children[0] = createFakeNode(createData(1));
children[1] = createFakeNode(createData(1));
children[0].getNodeStatistics().setBatchEndTime(100);
+ children[0].getNodeStatistics().collectCumulativeNodeStats(new TupleBatch(1, Collections.EMPTY_LIST), RelationalNodeStatistics.BATCHCOMPLETE_STOP);
children[0].getNodeStatistics().collectNodeStats(new RelationalNode[0]);
children[1].getNodeStatistics().setBatchEndTime(200);
+ children[1].getNodeStatistics().collectCumulativeNodeStats(new TupleBatch(1, Collections.EMPTY_LIST), RelationalNodeStatistics.BATCHCOMPLETE_STOP);
children[1].getNodeStatistics().collectNodeStats(new RelationalNode[0]);
RelationalNodeStatistics stats = new RelationalNodeStatistics();
stats.setBatchEndTime(1000);
stats.collectNodeStats(children);
assertEquals(1000, stats.getNodeCumulativeProcessingTime());
- assertEquals(700, stats.getNodeProcessingTime());
+ assertEquals(700, stats.getNodeNextBatchProcessingTime());
}
@Test public void testDescriptionProperties() throws Exception {