Skip to content

Commit

Permalink
Use getTotalFlushTimeExcludingWaitingOnLockInMillis
Browse files Browse the repository at this point in the history
  • Loading branch information
arteam committed Apr 11, 2024
1 parent 4ab7771 commit 27ec5c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ boolean throttleLockIsHeldByCurrentThread() { // to be used in assertions and te
/**
* Returns the total time flushes have been executed excluding waiting on locks.
*/
public long getFlushTimeExcludingWaitingOnLockInMillis() {
public long getTotalFlushTimeExcludingWaitingOnLockInMillis() {
return 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public class InternalEngine extends Engine {
private final CounterMetric numDocDeletes = new CounterMetric();
private final CounterMetric numDocAppends = new CounterMetric();
private final CounterMetric numDocUpdates = new CounterMetric();
private final MeanMetric flushTimeExcludingWaitingOnLock = new MeanMetric();
private final MeanMetric totalFlushTimeExcludingWaitingOnLock = new MeanMetric();

private final NumericDocValuesField softDeletesField = Lucene.newSoftDeletesField();
private final SoftDeletesPolicy softDeletesPolicy;
Expand Down Expand Up @@ -2251,7 +2251,7 @@ protected void flushHoldingLock(boolean force, boolean waitIfOngoing, ActionList
listener.onFailure(e);
return;
} finally {
flushTimeExcludingWaitingOnLock.inc(System.nanoTime() - startTime);
totalFlushTimeExcludingWaitingOnLock.inc(System.nanoTime() - startTime);
flushLock.unlock();
logger.trace("released flush lock");
}
Expand Down Expand Up @@ -3073,8 +3073,8 @@ long getNumDocUpdates() {
}

@Override
public long getFlushTimeExcludingWaitingOnLockInMillis() {
return TimeUnit.NANOSECONDS.toMillis(flushTimeExcludingWaitingOnLock.sum());
public long getTotalFlushTimeExcludingWaitingOnLockInMillis() {
return TimeUnit.NANOSECONDS.toMillis(totalFlushTimeExcludingWaitingOnLock.sum());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ public FlushStats flushStats() {
flushMetric.count(),
periodicFlushMetric.count(),
TimeUnit.NANOSECONDS.toMillis(flushMetric.sum()),
getEngineOrNull() != null ? getEngineOrNull().getFlushTimeExcludingWaitingOnLockInMillis() : 0L
getEngineOrNull() != null ? getEngineOrNull().getTotalFlushTimeExcludingWaitingOnLockInMillis() : 0L
);
}

Expand Down

0 comments on commit 27ec5c5

Please sign in to comment.