You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2016/03/04 23:54:51 UTC

svn commit: r1733673 - in /jmeter/trunk/src/core/org/apache/jmeter/threads: JMeterThread.java TestCompiler.java

Author: pmouawad
Date: Fri Mar  4 22:54:51 2016
New Revision: 1733673

URL: http://svn.apache.org/viewvc?rev=1733673&view=rev
Log:
rename variables for clarity
Contribution by Benoit Wiart 
#resolve #142
https://github.com/apache/jmeter/pull/142/

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java
    jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java?rev=1733673&r1=1733672&r2=1733673&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java Fri Mar  4 22:54:51 2016
@@ -75,7 +75,7 @@ public class JMeterThread implements Run
     private static final int RAMPUP_GRANULARITY =
             JMeterUtils.getPropDefault("jmeterthread.rampup.granularity", 1000); // $NON-NLS-1$
 
-    private final Controller controller;
+    private final Controller threadGroupLoopController;
 
     private final HashTree testTree;
 
@@ -140,7 +140,7 @@ public class JMeterThread implements Run
         threadVars = new JMeterVariables();
         testTree = test;
         compiler = new TestCompiler(testTree);
-        controller = (Controller) testTree.getArray()[0];
+        threadGroupLoopController = (Controller) testTree.getArray()[0];
         SearchByClass<TestIterationListener> threadListenerSearcher = new SearchByClass<>(TestIterationListener.class); // TL - IS
         test.traverse(threadListenerSearcher);
         testIterationStartListeners = threadListenerSearcher.getSearchResults();
@@ -235,7 +235,7 @@ public class JMeterThread implements Run
 
         try {
             iterationListener = initRun(threadContext);
-            Sampler sam = controller.next();
+            Sampler sam = threadGroupLoopController.next();
             while (running && sam != null) {
                 processSampler(sam, null, threadContext);
                 threadContext.cleanAfterSample();
@@ -261,12 +261,12 @@ public class JMeterThread implements Run
                     sam = null;
                 }
                 
-                if (sam == null && controller.isDone()) {
+                if (sam == null && threadGroupLoopController.isDone()) {
                     running = false;
                     log.info("Thread is done: " + threadName);
                 }
                 else {
-                    sam = controller.next();
+                    sam = threadGroupLoopController.next();
                 }
             }
         }
@@ -367,7 +367,6 @@ public class JMeterThread implements Run
      * @param threadContext
      * @return SampleResult if a transaction was processed
      */
-    
     private SampleResult processSampler(Sampler current, Sampler parent, JMeterContext threadContext) {
         SampleResult transactionResult = null;
         try {
@@ -432,7 +431,7 @@ public class JMeterThread implements Run
 
     /*
      * Execute the sampler with its pre/post processors, timers, assertions
-     * Brodcast the result to the sample listeners
+     * Broadcast the result to the sample listeners
      */
     private void executeSamplePackage(Sampler current,
             TransactionSampler transactionSampler,
@@ -597,9 +596,9 @@ public class JMeterThread implements Run
          */
         threadContext.setSamplingStarted(true);
         
-        controller.initialize();
+        threadGroupLoopController.initialize();
         IterationListener iterationListener = new IterationListener();
-        controller.addIterationListener(iterationListener);
+        threadGroupLoopController.addIterationListener(iterationListener);
 
         threadStarted();
         return iterationListener;
@@ -626,7 +625,7 @@ public class JMeterThread implements Run
             gp.getMainFrame().updateCounts();
         }
         if (iterationListener != null) { // probably not possible, but check anyway
-            controller.removeIterationListener(iterationListener);
+            threadGroupLoopController.removeIterationListener(iterationListener);
         }
     }
 
@@ -806,10 +805,10 @@ public class JMeterThread implements Run
         threadVars.incIteration();
         for (TestIterationListener listener : testIterationStartListeners) {
             if (listener instanceof TestElement) {
-                listener.testIterationStart(new LoopIterationEvent(controller, threadVars.getIteration()));
+                listener.testIterationStart(new LoopIterationEvent(threadGroupLoopController, threadVars.getIteration()));
                 ((TestElement) listener).recoverRunningVersion();
             } else {
-                listener.testIterationStart(new LoopIterationEvent(controller, threadVars.getIteration()));
+                listener.testIterationStart(new LoopIterationEvent(threadGroupLoopController, threadVars.getIteration()));
             }
         }
     }

Modified: jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java?rev=1733673&r1=1733672&r2=1733673&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java Fri Mar  4 22:54:51 2016
@@ -173,10 +173,10 @@ public class TestCompiler implements Has
         }
     }
 
-    private void trackIterationListeners(LinkedList<TestElement> p_stack) {
-        TestElement child = p_stack.getLast();
+    private void trackIterationListeners(LinkedList<TestElement> pStack) {
+        TestElement child = pStack.getLast();
         if (child instanceof LoopIterationListener) {
-            ListIterator<TestElement> iter = p_stack.listIterator(p_stack.size());
+            ListIterator<TestElement> iter = pStack.listIterator(pStack.size());
             while (iter.hasPrevious()) {
                 TestElement item = iter.previous();
                 if (item == child) {