Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,8 @@ public ByteBuf readEntry(long ledgerId, long entryId)
LOG.trace("Reading {}@{}", entryId, ledgerId);
}
ByteBuf entry = handle.readEntry(entryId);
bookieStats.getReadBytes().add(entry.readableBytes());
entrySize = entry.readableBytes();
bookieStats.getReadBytes().add(entrySize);
success = true;
return entry;
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,9 @@ public int process(boolean shouldForceWrite) throws IOException {
return 0;
}

long startTime = MathUtils.nowInNano();
try {
if (shouldForceWrite) {
long startTime = MathUtils.nowInNano();
this.logFile.forceWrite(false);
journalStats.getJournalSyncStats()
.registerSuccessfulEvent(MathUtils.elapsedNanos(startTime), TimeUnit.NANOSECONDS);
Expand All @@ -397,6 +397,10 @@ public int process(boolean shouldForceWrite) throws IOException {
}

return forceWriteWaiters.size();
} catch (IOException e) {
journalStats.getJournalSyncStats()
.registerFailedEvent(MathUtils.elapsedNanos(startTime), TimeUnit.NANOSECONDS);
throw e;
} finally {
closeFileIfNecessary();
}
Expand Down