Jmeter How to make counter related to thread number even in the next loop?












0















I face an issue currently in Jmeter which Thread number is not related to the counter. for examples we have a thread group configured as 3 threads which will run in 2 loops. We also use a counter from 11 to 13 in the this thread group.



When we run the following happens after the 1st loop:






<table>
<tr><td>Thread_Group_Number</td><td>Counter_Value</td><td>Status</td></tr>
<tr><td>1</td><td>11</td><td>Still running</td></tr>
<tr><td>2</td><td>12</td><td>Finished</td></tr>
<tr><td>3</td><td>13</td><td>Finished</td></tr>
</table>





Actual status when the 2nd loop starts:






<table>
<tr><td>Thread_Group_Number</td><td>Counter_Value</td><td>Status</td></tr>
<tr><td>2</td><td>11</td><td>Running</td></tr>
<tr><td>3</td><td>12</td><td>Running</td></tr>
</table>





Desired status when the 2nd loop starts:






<table>
<tr><td>Thread_Group_Number</td><td>Counter_Value</td><td>Status</td></tr>
<tr><td>2</td><td>12</td><td>Running</td></tr>
<tr><td>3</td><td>13</td><td>Running</td></tr>
</table>





Actual behavior:
Thread group is configured as follows:
Number of threads: 3
Loop Count: 2
Counter min: 11, max: 13, and increment by 1.



Screenshot for the actual behavior



I want in Thread 2 Loop 2 Counter value to be 12, Thread 1 Loop 2 Counter value to be 11, and Thread 3 Loop 2 Counter value to be 13. in other terms I want the value of counter in the following loops to be the same as the their values in the first loop at the same thread number.



How can I achieve that?










share|improve this question





























    0















    I face an issue currently in Jmeter which Thread number is not related to the counter. for examples we have a thread group configured as 3 threads which will run in 2 loops. We also use a counter from 11 to 13 in the this thread group.



    When we run the following happens after the 1st loop:






    <table>
    <tr><td>Thread_Group_Number</td><td>Counter_Value</td><td>Status</td></tr>
    <tr><td>1</td><td>11</td><td>Still running</td></tr>
    <tr><td>2</td><td>12</td><td>Finished</td></tr>
    <tr><td>3</td><td>13</td><td>Finished</td></tr>
    </table>





    Actual status when the 2nd loop starts:






    <table>
    <tr><td>Thread_Group_Number</td><td>Counter_Value</td><td>Status</td></tr>
    <tr><td>2</td><td>11</td><td>Running</td></tr>
    <tr><td>3</td><td>12</td><td>Running</td></tr>
    </table>





    Desired status when the 2nd loop starts:






    <table>
    <tr><td>Thread_Group_Number</td><td>Counter_Value</td><td>Status</td></tr>
    <tr><td>2</td><td>12</td><td>Running</td></tr>
    <tr><td>3</td><td>13</td><td>Running</td></tr>
    </table>





    Actual behavior:
    Thread group is configured as follows:
    Number of threads: 3
    Loop Count: 2
    Counter min: 11, max: 13, and increment by 1.



    Screenshot for the actual behavior



    I want in Thread 2 Loop 2 Counter value to be 12, Thread 1 Loop 2 Counter value to be 11, and Thread 3 Loop 2 Counter value to be 13. in other terms I want the value of counter in the following loops to be the same as the their values in the first loop at the same thread number.



    How can I achieve that?










    share|improve this question



























      0












      0








      0








      I face an issue currently in Jmeter which Thread number is not related to the counter. for examples we have a thread group configured as 3 threads which will run in 2 loops. We also use a counter from 11 to 13 in the this thread group.



      When we run the following happens after the 1st loop:






      <table>
      <tr><td>Thread_Group_Number</td><td>Counter_Value</td><td>Status</td></tr>
      <tr><td>1</td><td>11</td><td>Still running</td></tr>
      <tr><td>2</td><td>12</td><td>Finished</td></tr>
      <tr><td>3</td><td>13</td><td>Finished</td></tr>
      </table>





      Actual status when the 2nd loop starts:






      <table>
      <tr><td>Thread_Group_Number</td><td>Counter_Value</td><td>Status</td></tr>
      <tr><td>2</td><td>11</td><td>Running</td></tr>
      <tr><td>3</td><td>12</td><td>Running</td></tr>
      </table>





      Desired status when the 2nd loop starts:






      <table>
      <tr><td>Thread_Group_Number</td><td>Counter_Value</td><td>Status</td></tr>
      <tr><td>2</td><td>12</td><td>Running</td></tr>
      <tr><td>3</td><td>13</td><td>Running</td></tr>
      </table>





      Actual behavior:
      Thread group is configured as follows:
      Number of threads: 3
      Loop Count: 2
      Counter min: 11, max: 13, and increment by 1.



      Screenshot for the actual behavior



      I want in Thread 2 Loop 2 Counter value to be 12, Thread 1 Loop 2 Counter value to be 11, and Thread 3 Loop 2 Counter value to be 13. in other terms I want the value of counter in the following loops to be the same as the their values in the first loop at the same thread number.



      How can I achieve that?










      share|improve this question
















      I face an issue currently in Jmeter which Thread number is not related to the counter. for examples we have a thread group configured as 3 threads which will run in 2 loops. We also use a counter from 11 to 13 in the this thread group.



      When we run the following happens after the 1st loop:






      <table>
      <tr><td>Thread_Group_Number</td><td>Counter_Value</td><td>Status</td></tr>
      <tr><td>1</td><td>11</td><td>Still running</td></tr>
      <tr><td>2</td><td>12</td><td>Finished</td></tr>
      <tr><td>3</td><td>13</td><td>Finished</td></tr>
      </table>





      Actual status when the 2nd loop starts:






      <table>
      <tr><td>Thread_Group_Number</td><td>Counter_Value</td><td>Status</td></tr>
      <tr><td>2</td><td>11</td><td>Running</td></tr>
      <tr><td>3</td><td>12</td><td>Running</td></tr>
      </table>





      Desired status when the 2nd loop starts:






      <table>
      <tr><td>Thread_Group_Number</td><td>Counter_Value</td><td>Status</td></tr>
      <tr><td>2</td><td>12</td><td>Running</td></tr>
      <tr><td>3</td><td>13</td><td>Running</td></tr>
      </table>





      Actual behavior:
      Thread group is configured as follows:
      Number of threads: 3
      Loop Count: 2
      Counter min: 11, max: 13, and increment by 1.



      Screenshot for the actual behavior



      I want in Thread 2 Loop 2 Counter value to be 12, Thread 1 Loop 2 Counter value to be 11, and Thread 3 Loop 2 Counter value to be 13. in other terms I want the value of counter in the following loops to be the same as the their values in the first loop at the same thread number.



      How can I achieve that?






      <table>
      <tr><td>Thread_Group_Number</td><td>Counter_Value</td><td>Status</td></tr>
      <tr><td>1</td><td>11</td><td>Still running</td></tr>
      <tr><td>2</td><td>12</td><td>Finished</td></tr>
      <tr><td>3</td><td>13</td><td>Finished</td></tr>
      </table>





      <table>
      <tr><td>Thread_Group_Number</td><td>Counter_Value</td><td>Status</td></tr>
      <tr><td>1</td><td>11</td><td>Still running</td></tr>
      <tr><td>2</td><td>12</td><td>Finished</td></tr>
      <tr><td>3</td><td>13</td><td>Finished</td></tr>
      </table>





      <table>
      <tr><td>Thread_Group_Number</td><td>Counter_Value</td><td>Status</td></tr>
      <tr><td>2</td><td>11</td><td>Running</td></tr>
      <tr><td>3</td><td>12</td><td>Running</td></tr>
      </table>





      <table>
      <tr><td>Thread_Group_Number</td><td>Counter_Value</td><td>Status</td></tr>
      <tr><td>2</td><td>11</td><td>Running</td></tr>
      <tr><td>3</td><td>12</td><td>Running</td></tr>
      </table>





      <table>
      <tr><td>Thread_Group_Number</td><td>Counter_Value</td><td>Status</td></tr>
      <tr><td>2</td><td>12</td><td>Running</td></tr>
      <tr><td>3</td><td>13</td><td>Running</td></tr>
      </table>





      <table>
      <tr><td>Thread_Group_Number</td><td>Counter_Value</td><td>Status</td></tr>
      <tr><td>2</td><td>12</td><td>Running</td></tr>
      <tr><td>3</td><td>13</td><td>Running</td></tr>
      </table>






      multithreading jmeter counter threadgroup






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 26 '18 at 13:04







      Ahmed Gehad

















      asked Nov 26 '18 at 7:15









      Ahmed GehadAhmed Gehad

      14




      14
























          1 Answer
          1






          active

          oldest

          votes


















          0














          If you add Counter test element and configure it like:



          enter image description here



          You should get the behavior close to the one you expect



          enter image description here



          More information: How to Use a Counter in a JMeter Test






          share|improve this answer
























          • Thanks Dmitri, I've updated the post for better understanding. Could you please recheck it and help?

            – Ahmed Gehad
            Nov 26 '18 at 12:45












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53476276%2fjmeter-how-to-make-counter-related-to-thread-number-even-in-the-next-loop%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          If you add Counter test element and configure it like:



          enter image description here



          You should get the behavior close to the one you expect



          enter image description here



          More information: How to Use a Counter in a JMeter Test






          share|improve this answer
























          • Thanks Dmitri, I've updated the post for better understanding. Could you please recheck it and help?

            – Ahmed Gehad
            Nov 26 '18 at 12:45
















          0














          If you add Counter test element and configure it like:



          enter image description here



          You should get the behavior close to the one you expect



          enter image description here



          More information: How to Use a Counter in a JMeter Test






          share|improve this answer
























          • Thanks Dmitri, I've updated the post for better understanding. Could you please recheck it and help?

            – Ahmed Gehad
            Nov 26 '18 at 12:45














          0












          0








          0







          If you add Counter test element and configure it like:



          enter image description here



          You should get the behavior close to the one you expect



          enter image description here



          More information: How to Use a Counter in a JMeter Test






          share|improve this answer













          If you add Counter test element and configure it like:



          enter image description here



          You should get the behavior close to the one you expect



          enter image description here



          More information: How to Use a Counter in a JMeter Test







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 26 '18 at 8:25









          Dmitri TDmitri T

          74.6k33765




          74.6k33765













          • Thanks Dmitri, I've updated the post for better understanding. Could you please recheck it and help?

            – Ahmed Gehad
            Nov 26 '18 at 12:45



















          • Thanks Dmitri, I've updated the post for better understanding. Could you please recheck it and help?

            – Ahmed Gehad
            Nov 26 '18 at 12:45

















          Thanks Dmitri, I've updated the post for better understanding. Could you please recheck it and help?

          – Ahmed Gehad
          Nov 26 '18 at 12:45





          Thanks Dmitri, I've updated the post for better understanding. Could you please recheck it and help?

          – Ahmed Gehad
          Nov 26 '18 at 12:45




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53476276%2fjmeter-how-to-make-counter-related-to-thread-number-even-in-the-next-loop%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Wiesbaden

          Marschland

          Dieringhausen