You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/09/13 04:36:48 UTC

[GitHub] [pulsar] yuruguo opened a new pull request #12020: [testclient] Make option -time take effect in PerformanceClient

yuruguo opened a new pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020


   ### Motivation
   The option `-time` is just defined but does not work in `PerformanceClient`, which causes the client not exit after reaching the test duration even if the user sets this option like `bin/pulsar-perf websocket-producer -time 60 my-topic`.
   
   ### Modifications
   
   - Add a logic that the client exits after the difference between the current-time and the start -ime is greater than the test-duration
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-939593101


   @merlimat @k2la @massakam @codelipenghui @congbobo184 @zymap PTAL, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-922175009


   PTAL @merlimat @lhotari @eolivelli @codelipenghui @congbobo184 @zymap @BewareMyPower @hangc0276 @gaoran10 thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-924505683


   PTAL @merlimat @lhotari @eolivelli @codelipenghui @congbobo184 @zymap


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-943126107


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-922337785


   PTAL @eolivelli thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-922911386


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-943132093


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on a change in pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on a change in pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#discussion_r720937128



##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java
##########
@@ -244,10 +242,19 @@ public void runPerformanceTest(long messages, long limit, int numOfTopic, int si
         executor.submit(() -> {
             try {
                 RateLimiter rateLimiter = RateLimiter.create(limit);
+                long startTime = System.nanoTime();
+                long testEndTime = startTime + (long) (testTime * 1e9);
                 // Send messages on all topics/producers
                 long totalSent = 0;
                 while (true) {
                     for (String topic : producersMap.keySet()) {
+                        if (testTime > 0 && System.nanoTime() > testEndTime) {
+                            log.info("------------- DONE (reached the maximum duration: [{} seconds] of production) --------------", testTime);

Review comment:
       Can you help me look at it again? If my understanding is wrong, please explain to me and I will complete this pr as soon as possible, thx!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-948150390


   @eolivelli Can you look at it again? and I hope complete this pr as soon as possible, THX!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-945240544


   @eolivelli Can you help me look at it again? and I hope complete this pr as soon as possible, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-926361181


   PTAL @eolivelli 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-922175009


   PTAL @merlimat @lhotari @eolivelli @codelipenghui @congbobo184 @zymap @BewareMyPower @hangc0276 @gaoran10 , thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-943089058


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on a change in pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on a change in pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#discussion_r707946041



##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java
##########
@@ -242,10 +240,19 @@ public void runPerformanceTest(long messages, long limit, int numOfTopic, int si
         executor.submit(() -> {
             try {
                 RateLimiter rateLimiter = RateLimiter.create(limit);
+                long startTime = System.nanoTime();
+                long testEndTime = startTime + (long) (testTime * 1e9);
                 // Send messages on all topics/producers
                 long totalSent = 0;
                 while (true) {
                     for (String topic : producersMap.keySet()) {
+                        if (testTime > 0) {
+                            if (System.nanoTime() > testEndTime) {
+                                log.info("------------- DONE (reached the maximum duration: [{} seconds] of production) --------------", testTime);

Review comment:
       This [pr](https://github.com/apache/pulsar/pull/11985/files#diff-cf545bbba2c55f89cbaf23d8ef206e8ac765b82e2fe0652c3253a23c310f9d36R354) adds the `printAggregatedStats` method and it prints the total number of messages. After this pr is merged, I only need to call the method in line252.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] Anonymitaet commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
Anonymitaet commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-917987407


   Thanks for your contribution. For this PR, do we need to update docs?
   
   (The [PR template contains info about doc](https://github.com/apache/pulsar/blob/master/.github/PULL_REQUEST_TEMPLATE.md#documentation), which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks) 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-939389122


   @merlimat @k2la @massakam @codelipenghui @congbobo184 PTAL, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-921581239


   PTAL @merlimat @lhotari @eolivelli @sijie @congbobo184 @zymap @hangc0276 @gaoran10 thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-921285222


   PTAL @merlimat @lhotari @eolivelli @congbobo184 @zymap @hangc0276 @gaoran10 thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-924505683


   PTAL @merlimat @lhotari @eolivelli @codelipenghui @congbobo184 @zymap


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-942804185


   @merlimat @lhotari @k2la @sijie @codelipenghui @jiazhai @congbobo184 @hangc0276 @gaoran10 PTAL, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-920169618


   PTAL @merlimat @eolivelli @congbobo184 @zymap @hangc0276 @gaoran10 , thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-917989851


   > Thanks for your contribution. For this PR, do we need to update docs?
   > 
   > (The [PR template contains info about doc](https://github.com/apache/pulsar/blob/master/.github/PULL_REQUEST_TEMPLATE.md#documentation), which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)
   
   No need to update docs


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-917989851


   > Thanks for your contribution. For this PR, do we need to update docs?
   > 
   > (The [PR template contains info about doc](https://github.com/apache/pulsar/blob/master/.github/PULL_REQUEST_TEMPLATE.md#documentation), which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)
   
   No need to update docs


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-946668153


   @eolivelli Can you look at it again? and I hope complete this pr as soon as possible, THX!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-948150390


   @eolivelli Can you look at it again? and I hope complete this pr as soon as possible, THX!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-945240544


   @eolivelli Can you help me look at it again? and I hope complete this pr as soon as possible, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-946230970


   @eolivelli Can you look at it again? and I hope complete this pr as soon as possible, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-926361181


   PTAL @eolivelli 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-943208521


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-942804185


   @merlimat @lhotari @k2la @sijie @codelipenghui @jiazhai @congbobo184 @hangc0276 @gaoran10 PTAL, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-940630480


   @merlimat @k2la @massakam @codelipenghui @zhaijack @congbobo184 PTAL, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-946230970


   @eolivelli Can you look at it again? and I hope complete this pr as soon as possible, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-921285222


   PTAL @merlimat @lhotari @eolivelli @congbobo184 @zymap @hangc0276 @gaoran10 thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-920169618


   PTAL @merlimat @lhotari @eolivelli @congbobo184 @zymap @BewareMyPower @hangc0276 @gaoran10 thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-921581704


   PTAL @merlimat @lhotari @eolivelli @codelipenghui @congbobo184 @zymap @hangc0276 @gaoran10 thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-922978718


   PTAL @merlimat @lhotari @eolivelli @congbobo184 @zymap 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-922975427


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-922978718


   PTAL @merlimat @lhotari @eolivelli @codelipenghui @congbobo184 @zymap 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on a change in pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on a change in pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#discussion_r715982722



##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java
##########
@@ -244,10 +242,19 @@ public void runPerformanceTest(long messages, long limit, int numOfTopic, int si
         executor.submit(() -> {
             try {
                 RateLimiter rateLimiter = RateLimiter.create(limit);
+                long startTime = System.nanoTime();
+                long testEndTime = startTime + (long) (testTime * 1e9);
                 // Send messages on all topics/producers
                 long totalSent = 0;
                 while (true) {
                     for (String topic : producersMap.keySet()) {
+                        if (testTime > 0 && System.nanoTime() > testEndTime) {
+                            log.info("------------- DONE (reached the maximum duration: [{} seconds] of production) --------------", testTime);
+                            printAggregatedStats();
+                            Thread.sleep(5000);

Review comment:
       It is no problem to exit directly without sleeping.

##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java
##########
@@ -244,10 +242,19 @@ public void runPerformanceTest(long messages, long limit, int numOfTopic, int si
         executor.submit(() -> {
             try {
                 RateLimiter rateLimiter = RateLimiter.create(limit);
+                long startTime = System.nanoTime();
+                long testEndTime = startTime + (long) (testTime * 1e9);
                 // Send messages on all topics/producers
                 long totalSent = 0;
                 while (true) {
                     for (String topic : producersMap.keySet()) {
+                        if (testTime > 0 && System.nanoTime() > testEndTime) {
+                            log.info("------------- DONE (reached the maximum duration: [{} seconds] of production) --------------", testTime);

Review comment:
       Sorry, I understand that there is only one worker thread in the thread pool processing data (maybe we can add `--num-test-threads` to support multi-threading like `PerformanceProducer`), in this case, it will only be printed once. Am I correct?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-924888500


   PTAL @merlimat @lhotari @eolivelli @codelipenghui @congbobo184 @zymap 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-920169618


   PTAL @merlimat @lhotari @eolivelli @congbobo184 @zymap @hangc0276 @gaoran10 thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on a change in pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on a change in pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#discussion_r707946041



##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java
##########
@@ -242,10 +240,19 @@ public void runPerformanceTest(long messages, long limit, int numOfTopic, int si
         executor.submit(() -> {
             try {
                 RateLimiter rateLimiter = RateLimiter.create(limit);
+                long startTime = System.nanoTime();
+                long testEndTime = startTime + (long) (testTime * 1e9);
                 // Send messages on all topics/producers
                 long totalSent = 0;
                 while (true) {
                     for (String topic : producersMap.keySet()) {
+                        if (testTime > 0) {
+                            if (System.nanoTime() > testEndTime) {
+                                log.info("------------- DONE (reached the maximum duration: [{} seconds] of production) --------------", testTime);

Review comment:
       We could print throughput and delay data by adding a shutdown hook in other pr([Printing aggregated data when client exit](https://github.com/apache/pulsar/pull/11985/files#diff-cf545bbba2c55f89cbaf23d8ef206e8ac765b82e2fe0652c3253a23c310f9d36R335-R339)), which should meet your requirements.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-917835310


   PATL @merlimat @lhotari @eolivelli @codelipenghui @315157973 @congbobo184 @zymap @BewareMyPower @hangc0276 @gaoran10 thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-941848988


   @merlimat @k2la @codelipenghui @jiazhai @congbobo184 @hangc0276 @gaoran10 PTAL, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-947194951


   @eolivelli Can you look at it again? and I hope complete this pr as soon as possible, THX!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-944216439


   @eolivelli PTAL, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-922911386


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-922887180


   @eolivelli @congbobo184 PTAL, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-921581704


   PTAL @merlimat @lhotari @eolivelli @codelipenghui @315157973 @congbobo184 @zymap @BewareMyPower @hangc0276 @gaoran10 thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-939191520


   @merlimat @k2la @massakam PTAL, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-943075490


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-943092787


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-945127697


   @eolivelli PTAL again, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-946668153


   @eolivelli Can you look at it again? and I hope complete this pr as soon as possible, THX!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] eolivelli merged pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
eolivelli merged pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-924888500


   PTAL @eolivelli 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-920169618


   PTAL @merlimat @lhotari @eolivelli @congbobo184 @zymap @hangc0276 @gaoran10 thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-924599172


   > LGTM.
   > Why are the two judgment conditions not merged together?
   > 
   > ```
   > if (testTime > 0 && System.nanoTime() > testEndTime) 
   > ```
   
   In fact, there is no problem to merge together. 
   I have merged.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-940630480


   @merlimat @k2la @massakam @codelipenghui @jiazhai @congbobo184 PTAL, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-941011347


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-941011347


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-945127697


   @eolivelli PTAL again, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-924888500


   @merlimat @lhotari @eolivelli @aahmed-se @codelipenghui @BewareMyPower PTAL


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-924888500


   PTAL @merlimat @lhotari @eolivelli @codelipenghui @congbobo184 @zymap 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-926539032


   > The patch makes sense to me.
   > 
   > But please address the suggestions
   
   Thanks for your reply, I have updated according to the suggestions, please take a look again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-924888500


   @merlimat @lhotari @eolivelli @codelipenghui @congbobo184 @BewareMyPower PTAL


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-917835310


   PATL @merlimat @lhotari @eolivelli @codelipenghui @315157973 @congbobo184 @zymap @hangc0276 @gaoran10 thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] congbobo184 commented on a change in pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
congbobo184 commented on a change in pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#discussion_r707933405



##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java
##########
@@ -242,10 +240,19 @@ public void runPerformanceTest(long messages, long limit, int numOfTopic, int si
         executor.submit(() -> {
             try {
                 RateLimiter rateLimiter = RateLimiter.create(limit);
+                long startTime = System.nanoTime();
+                long testEndTime = startTime + (long) (testTime * 1e9);
                 // Send messages on all topics/producers
                 long totalSent = 0;
                 while (true) {
                     for (String topic : producersMap.keySet()) {
+                        if (testTime > 0) {
+                            if (System.nanoTime() > testEndTime) {
+                                log.info("------------- DONE (reached the maximum duration: [{} seconds] of production) --------------", testTime);

Review comment:
       could you please log print the total message numbers. when reach the test time.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-922337785


   PTAL @eolivelli thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-924599172


   > LGTM.
   > Why are the two judgment conditions not merged together?
   > 
   > ```
   > if (testTime > 0 && System.nanoTime() > testEndTime) 
   > ```
   
   In fact, there is no problem to merge together. it should be referred to `PerformanceProducer` for separate judgments, as follow:
   https://github.com/apache/pulsar/blob/4ddbf6f909634751cc2cf1155daa462922416536/pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceProducer.java#L602-L605


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-920993237


   PTAL @BewareMyPower  thanks for your time!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-922175009


   PTAL @merlimat @lhotari @eolivelli @codelipenghui @congbobo184 @zymap @hangc0276 @gaoran10 , thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-924599172


   > LGTM.
   > Why are the two judgment conditions not merged together?
   > 
   > ```
   > if (testTime > 0 && System.nanoTime() > testEndTime) 
   > ```
   
   In fact, there is no problem to merge together. it should be referred to `PerformanceProducer` for separate judgments, as follow:
   https://github.com/apache/pulsar/blob/4ddbf6f909634751cc2cf1155daa462922416536/pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceProducer.java#L601-L610


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-939191520


   @merlimat @k2la @massakam PTAL, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-921581704


   PTAL @merlimat @lhotari @eolivelli @codelipenghui @315157973 @congbobo184 @zymap @BewareMyPower @hangc0276 @gaoran10 thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-939389122


   @merlimat @k2la @massakam @codelipenghui @congbobo184 PTAL, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-941848988


   @merlimat @k2la @codelipenghui @jiazhai @congbobo184 @hangc0276 @gaoran10 PTAL, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-947194951


   @eolivelli Can you look at it again? and I hope complete this pr as soon as possible, THX!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-943092787


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on a change in pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on a change in pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#discussion_r728683903



##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java
##########
@@ -244,10 +242,19 @@ public void runPerformanceTest(long messages, long limit, int numOfTopic, int si
         executor.submit(() -> {
             try {
                 RateLimiter rateLimiter = RateLimiter.create(limit);
+                long startTime = System.nanoTime();
+                long testEndTime = startTime + (long) (testTime * 1e9);
                 // Send messages on all topics/producers
                 long totalSent = 0;
                 while (true) {
                     for (String topic : producersMap.keySet()) {
+                        if (testTime > 0 && System.nanoTime() > testEndTime) {
+                            log.info("------------- DONE (reached the maximum duration: [{} seconds] of production) --------------", testTime);
+                            printAggregatedStats();
+                            Thread.sleep(5000);

Review comment:
       > Can we remove this line?
   
   sure. Done. PTAL again, thx!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-922887180


   @eolivelli @congbobo184 PTAL, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-924599172


   > LGTM.
   > Why are the two judgment conditions not merged together?
   > 
   > ```
   > if (testTime > 0 && System.nanoTime() > testEndTime) 
   > ```
   
   In fact, there is no problem to merge together. 
   I have merged.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-941848988


   @merlimat @k2la @codelipenghui @jiazhai @congbobo184 @hangc0276 @gaoran10 PTAL, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-917835310


   PTAL @merlimat  @eolivelli  @lhotari  @codelipenghui  @hangc0276  @315157973  @gaoran10 @congbobo184 @zymap 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-917835310


   @merlimat @lhotari @eolivelli @codelipenghui @315157973 @congbobo184 @zymap @hangc0276 @gaoran10 PATL,thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on a change in pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on a change in pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#discussion_r709344217



##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java
##########
@@ -242,10 +240,19 @@ public void runPerformanceTest(long messages, long limit, int numOfTopic, int si
         executor.submit(() -> {
             try {
                 RateLimiter rateLimiter = RateLimiter.create(limit);
+                long startTime = System.nanoTime();
+                long testEndTime = startTime + (long) (testTime * 1e9);
                 // Send messages on all topics/producers
                 long totalSent = 0;
                 while (true) {
                     for (String topic : producersMap.keySet()) {
+                        if (testTime > 0) {
+                            if (System.nanoTime() > testEndTime) {
+                                log.info("------------- DONE (reached the maximum duration: [{} seconds] of production) --------------", testTime);

Review comment:
       We could print throughput and delay data by adding a shutdown hook in other pr([Printing aggregated data when client exit](https://github.com/apache/pulsar/pull/11985/files#diff-cf545bbba2c55f89cbaf23d8ef206e8ac765b82e2fe0652c3253a23c310f9d36R335-R339)), which should meet your requirements.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-920993237


   PTAL @BewareMyPower  thanks for your time!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-924888500


   @merlimat @lhotari @eolivelli @codelipenghui @BewareMyPower @hangc0276 PTAL


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] eolivelli commented on a change in pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#discussion_r715574615



##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java
##########
@@ -244,10 +242,19 @@ public void runPerformanceTest(long messages, long limit, int numOfTopic, int si
         executor.submit(() -> {
             try {
                 RateLimiter rateLimiter = RateLimiter.create(limit);
+                long startTime = System.nanoTime();
+                long testEndTime = startTime + (long) (testTime * 1e9);
                 // Send messages on all topics/producers
                 long totalSent = 0;
                 while (true) {
                     for (String topic : producersMap.keySet()) {
+                        if (testTime > 0 && System.nanoTime() > testEndTime) {
+                            log.info("------------- DONE (reached the maximum duration: [{} seconds] of production) --------------", testTime);
+                            printAggregatedStats();
+                            Thread.sleep(5000);

Review comment:
       Why do you need this Sleep ?

##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java
##########
@@ -244,10 +242,19 @@ public void runPerformanceTest(long messages, long limit, int numOfTopic, int si
         executor.submit(() -> {
             try {
                 RateLimiter rateLimiter = RateLimiter.create(limit);
+                long startTime = System.nanoTime();
+                long testEndTime = startTime + (long) (testTime * 1e9);
                 // Send messages on all topics/producers
                 long totalSent = 0;
                 while (true) {
                     for (String topic : producersMap.keySet()) {
+                        if (testTime > 0 && System.nanoTime() > testEndTime) {
+                            log.info("------------- DONE (reached the maximum duration: [{} seconds] of production) --------------", testTime);

Review comment:
       this code will be executed by several thread concurrently.
   can we set a flag and print out this like only once ?
   otherwise the effect will not be veryuser-friendly




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-944216439






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-924599172


   > LGTM.
   > Why are the two judgment conditions not merged together?
   > 
   > ```
   > if (testTime > 0 && System.nanoTime() > testEndTime) 
   > ```
   
   In fact, there is no problem to merge together. it should be referred to `PerformanceProducer` for separate judgments, as follow:
   https://github.com/apache/pulsar/blob/4ddbf6f909634751cc2cf1155daa462922416536/pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceProducer.java#L602-L604


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-940630480


   @merlimat @k2la @massakam @codelipenghui @jiazhai @congbobo184 PTAL, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-943208521


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-921581239


   PTAL @merlimat @lhotari @eolivelli @sijie @congbobo184 @zymap @hangc0276 @gaoran10 thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-943075490


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-940630480


   @merlimat @k2la @massakam @codelipenghui @jiazhai @congbobo184 PTAL, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui commented on a change in pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on a change in pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#discussion_r728679468



##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java
##########
@@ -244,10 +242,19 @@ public void runPerformanceTest(long messages, long limit, int numOfTopic, int si
         executor.submit(() -> {
             try {
                 RateLimiter rateLimiter = RateLimiter.create(limit);
+                long startTime = System.nanoTime();
+                long testEndTime = startTime + (long) (testTime * 1e9);
                 // Send messages on all topics/producers
                 long totalSent = 0;
                 while (true) {
                     for (String topic : producersMap.keySet()) {
+                        if (testTime > 0 && System.nanoTime() > testEndTime) {
+                            log.info("------------- DONE (reached the maximum duration: [{} seconds] of production) --------------", testTime);
+                            printAggregatedStats();
+                            Thread.sleep(5000);

Review comment:
       Can we remove this line?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-922898525


   PTAL @merlimat @eolivelli @congbobo184 @zymap


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-921581704


   PTAL @merlimat @lhotari @eolivelli @codelipenghui @315157973 @congbobo184 @zymap @hangc0276 @gaoran10 thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-922175009


   PTAL @merlimat @lhotari @eolivelli @codelipenghui @congbobo184 @zymap @hangc0276 @gaoran10 , thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-917835310


   PATL @merlimat @lhotari @eolivelli @codelipenghui @315157973 @congbobo184 @zymap @BewareMyPower @hangc0276 @gaoran10 thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-948468407


   @eolivelli Can you look at it again? and I hope complete this pr as soon as possible, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] eolivelli commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
eolivelli commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-948545063


   committed!
   thank you


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-948468407


   @eolivelli Can you look at it again? and I hope complete this pr as soon as possible, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-943089058


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-922975427


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-920169618


   PTAL @merlimat @lhotari @eolivelli @congbobo184 @zymap @hangc0276 @gaoran10 thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on a change in pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on a change in pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#discussion_r707031944



##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java
##########
@@ -185,13 +185,11 @@ public Arguments loadArguments(String[] args) {
             arguments.proxyURL += "/";
         }
 
-        arguments.testTime = TimeUnit.SECONDS.toMillis(arguments.testTime);

Review comment:
       There is no need to perform unit conversion here, just pass the original value(unit is second). Because if it is converted here, we need to convert it back when printing later(code in [line251](https://github.com/apache/pulsar/pull/12020/files#diff-cf545bbba2c55f89cbaf23d8ef206e8ac765b82e2fe0652c3253a23c310f9d36R251)). And it’s not handled(that is, unit conversion) in `PerformanceConsumer.java`,`PerformanceReader.java` and `PerformanceProducer.java`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] zymap commented on a change in pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
zymap commented on a change in pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#discussion_r707023470



##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java
##########
@@ -185,13 +185,11 @@ public Arguments loadArguments(String[] args) {
             arguments.proxyURL += "/";
         }
 
-        arguments.testTime = TimeUnit.SECONDS.toMillis(arguments.testTime);

Review comment:
       Why removed this? The performance consumer is using that.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on a change in pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on a change in pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#discussion_r707936525



##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java
##########
@@ -242,10 +240,19 @@ public void runPerformanceTest(long messages, long limit, int numOfTopic, int si
         executor.submit(() -> {
             try {
                 RateLimiter rateLimiter = RateLimiter.create(limit);
+                long startTime = System.nanoTime();
+                long testEndTime = startTime + (long) (testTime * 1e9);
                 // Send messages on all topics/producers
                 long totalSent = 0;
                 while (true) {
                     for (String topic : producersMap.keySet()) {
+                        if (testTime > 0) {
+                            if (System.nanoTime() > testEndTime) {
+                                log.info("------------- DONE (reached the maximum duration: [{} seconds] of production) --------------", testTime);

Review comment:
       It has been added in another [pr](https://github.com/apache/pulsar/pull/12016/files#diff-cf545bbba2c55f89cbaf23d8ef206e8ac765b82e2fe0652c3253a23c310f9d36R251), and then merge will be fine.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-922898525


   PTAL @merlimat @eolivelli @congbobo184 @zymap


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-922978718


   PTAL @merlimat @lhotari @eolivelli @codelipenghui @congbobo184 @zymap 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo edited a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-924888500


   @merlimat @lhotari @eolivelli @codelipenghui @BewareMyPower PTAL


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-939593101


   @merlimat @k2la @massakam @codelipenghui @congbobo184 @zymap PTAL, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on a change in pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on a change in pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#discussion_r726678787



##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java
##########
@@ -244,10 +242,19 @@ public void runPerformanceTest(long messages, long limit, int numOfTopic, int si
         executor.submit(() -> {
             try {
                 RateLimiter rateLimiter = RateLimiter.create(limit);
+                long startTime = System.nanoTime();
+                long testEndTime = startTime + (long) (testTime * 1e9);
                 // Send messages on all topics/producers
                 long totalSent = 0;
                 while (true) {
                     for (String topic : producersMap.keySet()) {
+                        if (testTime > 0 && System.nanoTime() > testEndTime) {
+                            log.info("------------- DONE (reached the maximum duration: [{} seconds] of production) --------------", testTime);

Review comment:
       Can you help me look at it again? If my understanding is wrong, please explain to me and I will complete this pr as soon as possible, thx!

##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java
##########
@@ -244,10 +242,19 @@ public void runPerformanceTest(long messages, long limit, int numOfTopic, int si
         executor.submit(() -> {
             try {
                 RateLimiter rateLimiter = RateLimiter.create(limit);
+                long startTime = System.nanoTime();
+                long testEndTime = startTime + (long) (testTime * 1e9);
                 // Send messages on all topics/producers
                 long totalSent = 0;
                 while (true) {
                     for (String topic : producersMap.keySet()) {
+                        if (testTime > 0 && System.nanoTime() > testEndTime) {
+                            log.info("------------- DONE (reached the maximum duration: [{} seconds] of production) --------------", testTime);

Review comment:
       Can you help me look at it again? If my understanding is wrong, please explain to me and I will complete this pr as soon as possible, thx!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-944892477


   @eolivelli PTAL again, thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo commented on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-943126107


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] yuruguo removed a comment on pull request #12020: [testclient] Make option -time take effect in PerformanceClient

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #12020:
URL: https://github.com/apache/pulsar/pull/12020#issuecomment-943132093


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org