mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-12-25 08:11:06 -06:00
memoize retries in hot code path
This commit is contained in:
parent
ebb6f2c58d
commit
b8684107bb
@ -53,11 +53,13 @@ public class StandardAction<A extends StandardActivity<R, ?>, R extends Op> impl
|
||||
private final Timer bindTimer;
|
||||
private final NBErrorHandler errorHandler;
|
||||
private final OpSequence<OpDispenser<? extends Op>> opsequence;
|
||||
private final int maxTries;
|
||||
|
||||
public StandardAction(A activity, int slot) {
|
||||
this.activity = activity;
|
||||
this.opsequence = activity.getOpSequence();
|
||||
this.slot = slot;
|
||||
this.maxTries = activity.getMaxTries();
|
||||
bindTimer = activity.getInstrumentation().getOrCreateBindTimer();
|
||||
executeTimer = activity.getInstrumentation().getOrCreateExecuteTimer();
|
||||
triesHistogram = activity.getInstrumentation().getOrCreateTriesHistogram();
|
||||
@ -84,7 +86,7 @@ public class StandardAction<A extends StandardActivity<R, ?>, R extends Op> impl
|
||||
while (op != null) {
|
||||
|
||||
int tries = 0;
|
||||
while (tries++ <= activity.getMaxTries()) {
|
||||
while (tries++ <= maxTries) {
|
||||
Throwable error = null;
|
||||
long startedAt = System.nanoTime();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user