tjiuming commented on a change in pull request #13833:
URL: https://github.com/apache/pulsar/pull/13833#discussion_r795012779
##########
File path:
tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlockAwareSegmentInputStreamImpl.java
##########
@@ -113,11 +124,18 @@ private int readEntries() throws IOException {
private List<ByteBuf> readNextEntriesFromLedger(long start, long
maxNumberEntries) throws IOException {
long end = Math.min(start + maxNumberEntries - 1,
ledger.getLastAddConfirmed());
+ long startTime = System.nanoTime();
try (LedgerEntries ledgerEntriesOnce = ledger.readAsync(start,
end).get()) {
- log.debug("read ledger entries. start: {}, end: {}", start, end);
+ if (log.isDebugEnabled()) {
+ log.debug("read ledger entries. start: {}, end: {} cost {}",
start, end,
+ TimeUnit.NANOSECONDS.toMicros(System.nanoTime() -
startTime));
+ }
+ if (mxBean != null && ledgerNameForMetrics != null) {
+ mxBean.recordReadLedgerLatency(ledgerNameForMetrics,
System.nanoTime() - startTime,
+ TimeUnit.NANOSECONDS);
+ }
List<ByteBuf> entries = Lists.newLinkedList();
-
Iterator<LedgerEntry> iterator = ledgerEntriesOnce.iterator();
Review comment:
seems SNIP20 didn't mentioned it.
--
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]