You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2022/05/20 15:05:54 UTC
[pulsar] 12/31: [improve][java-client] Add pending messages information while print the producer stats (#15440)
This is an automated email from the ASF dual-hosted git repository.
penghui pushed a commit to branch branch-2.10
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit 5a9b56a9865399ed2577abb43940a53118a1d49f
Author: lipenghui <pe...@apache.org>
AuthorDate: Thu May 5 18:37:38 2022 +0800
[improve][java-client] Add pending messages information while print the producer stats (#15440)
(cherry picked from commit fbe650ce72462e97ca1ba8f9dcb41ab1b7ce47bd)
---
.../org/apache/pulsar/client/impl/ProducerStatsRecorderImpl.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerStatsRecorderImpl.java b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerStatsRecorderImpl.java
index 29b8cf28c31..1f1b5b2efe7 100644
--- a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerStatsRecorderImpl.java
+++ b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerStatsRecorderImpl.java
@@ -182,7 +182,8 @@ public class ProducerStatsRecorderImpl implements ProducerStatsRecorder {
+ "BatchSize: med: {} - 95pct: {} - 99pct: {} - 99.9pct: {} - max: {} --- "
+ "MsgSize: med: {} bytes - 95pct: {} bytes - 99pct: {} bytes - 99.9pct: {} bytes "
+ "- max: {} bytes --- "
- + "Ack received rate: {} ack/s --- Failed messages: {}", producer.getTopic(),
+ + "Ack received rate: {} ack/s --- Failed messages: {} --- Pending messages: {}",
+ producer.getTopic(),
producer.getProducerName(), producer.getPendingQueueSize(),
THROUGHPUT_FORMAT.format(sendMsgsRate),
THROUGHPUT_FORMAT.format(sendBytesRate / 1024 / 1024 * 8),
@@ -195,7 +196,8 @@ public class ProducerStatsRecorderImpl implements ProducerStatsRecorder {
DEC.format(msgSizePctValues[0]), DEC.format(msgSizePctValues[2]),
DEC.format(msgSizePctValues[3]), DEC.format(msgSizePctValues[4]),
DEC.format(msgSizePctValues[5]),
- THROUGHPUT_FORMAT.format(currentNumAcksReceived / elapsed), currentNumSendFailedMsgs);
+ THROUGHPUT_FORMAT.format(currentNumAcksReceived / elapsed), currentNumSendFailedMsgs,
+ getPendingQueueSize());
}
}