congbobo184 commented on a change in pull request #11933:
URL: https://github.com/apache/pulsar/pull/11933#discussion_r713581526
##########
File path:
pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceConsumer.java
##########
@@ -406,34 +497,90 @@ public static void main(String[] args) throws Exception {
long total = totalMessagesReceived.sum();
double rate = messagesReceived.sumThenReset() / elapsed;
double throughput = bytesReceived.sumThenReset() / elapsed * 8 /
1024 / 1024;
-
+ double rateAck = messageAck.sumThenReset() / elapsed;
+ long totalTxnOpSuccessNum = 0;
+ long totalTxnOpFailNum = 0;
+ double rateOpenTxn = 0;
+ if (arguments.isEnableTransaction) {
+ totalTxnOpSuccessNum = totalEndTxnOpSuccessNum.sum();
+ totalTxnOpFailNum = totalEndTxnOpFailNum.sum();
+ rateOpenTxn = numTxnOp.sumThenReset() / elapsed;
+ }
reportHistogram = recorder.getIntervalHistogram(reportHistogram);
+ if(arguments.isEnableTransaction) {
+ log.info(
+ "Throughput received: {} msg --- {} msg/s -- {}
Mbit/s "
+ + "--- Transaction: {} transaction end
successfully --- {} transaction end failed "
+ + "--- {} Txn/s --- AckRate: {} msg/s"
+ + "--- Latency: mean: {} ms - med: {} "
+ + "- 95pct: {} - 99pct: {} - 99.9pct: {} -
99.99pct: {} - Max: {}",
+ intFormat.format(total),
+ dec.format(rate), dec.format(throughput),
+ totalTxnOpSuccessNum,
+ totalTxnOpFailNum,
+ dec.format(rateOpenTxn),
+ dec.format(rateAck),
+ dec.format(reportHistogram.getMean()),
+ reportHistogram.getValueAtPercentile(50),
reportHistogram.getValueAtPercentile(95),
+ reportHistogram.getValueAtPercentile(99),
reportHistogram.getValueAtPercentile(99.9),
+ reportHistogram.getValueAtPercentile(99.99),
reportHistogram.getMaxValue());
+ }else {
log.info(
- "Throughput received: {} msg --- {} msg/s -- {} Mbit/s
--- Latency: mean: {} ms - med: {} - 95pct: {} - 99pct: {} - 99.9pct: {} -
99.99pct: {} - Max: {}",
+ "Throughput received: {} msg --- {} msg/s -- {} Mbit/s "
+ + "--- Latency: mean: {} ms - med: {} "
+ + "- 95pct: {} - 99pct: {} - 99.9pct: {} -
99.99pct: {} - Max: {}",
intFormat.format(total),
dec.format(rate), dec.format(throughput),
dec.format(reportHistogram.getMean()),
reportHistogram.getValueAtPercentile(50),
reportHistogram.getValueAtPercentile(95),
reportHistogram.getValueAtPercentile(99),
reportHistogram.getValueAtPercentile(99.9),
reportHistogram.getValueAtPercentile(99.99),
reportHistogram.getMaxValue());
-
reportHistogram.reset();
oldTime = now;
- }
+ }}
pulsarClient.close();
}
- private static void printAggregatedThroughput(long start) {
+ private static void printAggregatedThroughput(long start, Arguments
arguments) {
double elapsed = (System.nanoTime() - start) / 1e9;
double rate = totalMessagesReceived.sum() / elapsed;
double throughput = totalBytesReceived.sum() / elapsed * 8 / 1024 /
1024;
+ long totalEndTxnSuccess = 0;
+ long totalEndTxnFail = 0;
+ long totalnumMessageAckFailed = 0;
+ double rateAck = totalMessageAck.sum() / elapsed;
+ double rateOpenTxn = 0;
+ if (arguments.isEnableTransaction) {
+ totalEndTxnSuccess = totalEndTxnOpSuccessNum.sum();
+ totalEndTxnFail = totalEndTxnOpFailNum.sum();
+ rateOpenTxn = (totalEndTxnSuccess + totalEndTxnFail) / elapsed;
+ totalnumMessageAckFailed = totalMessageAckFailed.sum();
+ }
+ if(arguments.isEnableTransaction){
Review comment:
I think we only need to print the log added by transaction when enable,
don't need change the original log logic.
--
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]