zjncs opened a new pull request, #11134:
URL: https://github.com/apache/rocketmq/pull/11134

   ### Motivation
   
   `mqadmin clusterSendMsgRT -a 1` cannot measure anything: the only send is 
the warm-up sample, elapsed stays 0, and the RT is computed as 0/0 = `NaN`. In 
tlog mode `new BigDecimal(NaN)` then throws `NumberFormatException` on the very 
first round, aborting the whole monitoring command.
   
   ### Modifications
   
   Reject an amount below two up front with a clear usage message, since at 
least two messages are required for a measured RT.
   
   ### Verification
   
   Fail-before (new test, run against the unpatched code):
   
   ```
   ClusterSendMsgRTCommandTest#testAmountBelowTwoIsRejected
   java.lang.AssertionError: ClusterSendMsgRTCommand command failed ; Infinite 
or NaN
   (warm-up-only run computed RT = 0/0 = NaN and BigDecimal rejected it on the 
first round)
   ```
   
   Pass-after:
   
   ```
   Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 -- 
ClusterSendMsgRTCommandTest
   ```
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to