From f5b433a189c95e6a39bdb952ce9d7cf0cbe1cbca Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Tue, 29 Oct 2024 12:43:22 +0800 Subject: [PATCH] Fix the publish latency unit (#1405) (cherry picked from commit 423ae3e23ae151b3b7fb48c48b47eb09be963411) --- .../io/streamnative/pulsar/handlers/amqp/AmqpEntryWriter.java | 2 +- .../pulsar/handlers/amqp/AmqpExchangeReplicator.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/amqp-impl/src/main/java/io/streamnative/pulsar/handlers/amqp/AmqpEntryWriter.java b/amqp-impl/src/main/java/io/streamnative/pulsar/handlers/amqp/AmqpEntryWriter.java index 3b755298..432056c7 100644 --- a/amqp-impl/src/main/java/io/streamnative/pulsar/handlers/amqp/AmqpEntryWriter.java +++ b/amqp-impl/src/main/java/io/streamnative/pulsar/handlers/amqp/AmqpEntryWriter.java @@ -96,7 +96,7 @@ public void addComplete(Position position, ByteBuf entryData, Object ctx) { if (log.isDebugEnabled()) { log.debug("[{}] Success to write entry with position {}.", topic.getName(), position); } - topic.recordAddLatency(System.nanoTime() - context.startTimeNs, TimeUnit.MICROSECONDS); + topic.recordAddLatency(System.nanoTime() - context.startTimeNs, TimeUnit.NANOSECONDS); topic.getTransactionBuffer().syncMaxReadPositionForNormalPublish((PositionImpl) position, false); context.positionFuture.complete(position); context.recycle(); diff --git a/amqp-impl/src/main/java/io/streamnative/pulsar/handlers/amqp/AmqpExchangeReplicator.java b/amqp-impl/src/main/java/io/streamnative/pulsar/handlers/amqp/AmqpExchangeReplicator.java index 013950e8..1b65dcc0 100644 --- a/amqp-impl/src/main/java/io/streamnative/pulsar/handlers/amqp/AmqpExchangeReplicator.java +++ b/amqp-impl/src/main/java/io/streamnative/pulsar/handlers/amqp/AmqpExchangeReplicator.java @@ -190,7 +190,6 @@ private void readMoreEntries() { messagesToRead = Math.max(messagesToRead, 1); if (HAVE_PENDING_READ_UPDATER.compareAndSet(this, FALSE, TRUE)) { - log.info("{} Schedule read of {} messages.", name, messagesToRead); if (log.isDebugEnabled()) { log.debug("{} Schedule read of {} messages.", name, messagesToRead); }