Class OpTrackerImpl<D>
java.lang.Object
io.nosqlbench.engine.api.activityapi.core.ops.fluent.OpTrackerImpl<D>
- Type Parameters:
D- The payload data type of the associated Op, based on OpImpl
- All Implemented Interfaces:
ActivityDefObserver,OpEvents<D>,OpTracker<D>
public class OpTrackerImpl<D> extends java.lang.Object implements OpTracker<D>, ActivityDefObserver
This tracker keeps track of the state of operations associated with it.
-
Constructor Summary
Constructors Constructor Description OpTrackerImpl(Activity activity, long slot)OpTrackerImpl(java.lang.String name, int slot, com.codahale.metrics.Timer cycleServiceTimer, com.codahale.metrics.Timer cycleResponseTimer, com.codahale.metrics.Counter pendingOpsCounter) -
Method Summary
Modifier and Type Method Description booleanawaitCompletion(long timeout)intgetMaxPendingOps()The maximum pending ops determines how many ops an activity is allowed to have in flight at any one time.intgetPendingOps()booleanisFull()TrackedOp<D>newOp(long cycle, OpEvents<D> strideTracker)voidonActivityDefUpdate(io.nosqlbench.engine.api.activityimpl.ActivityDef activityDef)voidonOpFailure(FailedOp<D> op)voidonOpSkipped(SkippedOp<D> op)voidonOpStarted(StartedOp<D> op)voidonOpSuccess(SucceededOp<D> op)voidsetCycleOpFunction(java.util.function.LongFunction<D> newOpFunction)The cycle op function is the function which can map a cycle number into an operation of some sort.voidsetMaxPendingOps(int maxPendingOps)java.lang.StringtoString()
-
Constructor Details
-
OpTrackerImpl
-
OpTrackerImpl
public OpTrackerImpl(java.lang.String name, int slot, com.codahale.metrics.Timer cycleServiceTimer, com.codahale.metrics.Timer cycleResponseTimer, com.codahale.metrics.Counter pendingOpsCounter)
-
-
Method Details
-
onOpStarted
- Specified by:
onOpStartedin interfaceOpEvents<D>
-
onOpSuccess
- Specified by:
onOpSuccessin interfaceOpEvents<D>
-
onOpSkipped
- Specified by:
onOpSkippedin interfaceOpEvents<D>
-
onOpFailure
- Specified by:
onOpFailurein interfaceOpEvents<D>
-
setMaxPendingOps
public void setMaxPendingOps(int maxPendingOps)- Specified by:
setMaxPendingOpsin interfaceOpTracker<D>
-
isFull
public boolean isFull() -
getPendingOps
public int getPendingOps()- Specified by:
getPendingOpsin interfaceOpTracker<D>
-
setCycleOpFunction
Description copied from interface:OpTrackerThe cycle op function is the function which can map a cycle number into an operation of some sort.- Specified by:
setCycleOpFunctionin interfaceOpTracker<D>
-
newOp
-
getMaxPendingOps
public int getMaxPendingOps()Description copied from interface:OpTrackerThe maximum pending ops determines how many ops an activity is allowed to have in flight at any one time. When- Specified by:
getMaxPendingOpsin interfaceOpTracker<D>- Returns:
-
awaitCompletion
public boolean awaitCompletion(long timeout)- Specified by:
awaitCompletionin interfaceOpTracker<D>
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
onActivityDefUpdate
public void onActivityDefUpdate(io.nosqlbench.engine.api.activityimpl.ActivityDef activityDef)- Specified by:
onActivityDefUpdatein interfaceActivityDefObserver
-