Skip to content

Commit 887c539

Browse files
committed
Fix consumer message latency downsampling
References #129
1 parent ce3f9fa commit 887c539

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/main/java/com/rabbitmq/stream/impl/Client.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,9 @@ public long queryPublisherSequence(String publisherReference, String stream) {
11411141
request.block();
11421142
QueryPublisherSequenceResponse response = request.response.get();
11431143
if (!response.isOk()) {
1144-
LOGGER.info("Query publisher sequence failed with code {}", formatConstant(response.getResponseCode()));
1144+
LOGGER.info(
1145+
"Query publisher sequence failed with code {}",
1146+
formatConstant(response.getResponseCode()));
11451147
}
11461148
return response.getSequence();
11471149
} catch (RuntimeException e) {

src/main/java/com/rabbitmq/stream/perf/StreamPerfTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ public Integer call() throws Exception {
789789
// become a bottleneck,
790790
// so we downsample and calculate latency for every x message
791791
// this should not affect the metric much
792-
if (messageCount.incrementAndGet() % 100 == divisor) {
792+
if (messageCount.incrementAndGet() % divisor == 0) {
793793
try {
794794
long time = Utils.readLong(message.getBodyAsBinary());
795795
// see above why we use current time to measure latency

0 commit comments

Comments
 (0)