Class StrideTracker<D>
- java.lang.Object
-
- io.engineblock.activityapi.cyclelog.buffers.Buffer<CompletedOp<D>>
-
- io.engineblock.activityimpl.motor.StrideTracker<D>
-
- All Implemented Interfaces:
OpEvents<D>,CycleResultsSegment,java.lang.Comparable<CycleResultsSegment>,java.lang.Iterable<CycleResult>
public class StrideTracker<D> extends Buffer<CompletedOp<D>> implements OpEvents<D>, CycleResultsSegment
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.engineblock.activityapi.cyclelog.buffers.results.CycleResultsSegment
CycleResultsSegment.EmptySegment
-
-
Field Summary
-
Fields inherited from interface io.engineblock.activityapi.cyclelog.buffers.results.CycleResultsSegment
EMPTY
-
-
Constructor Summary
Constructors Constructor Description StrideTracker(com.codahale.metrics.Timer strideServiceTimer, com.codahale.metrics.Timer strideResponseTimer, long strideWaitTime, long initialCycle, int size, Output output, StrideOutputConsumer<D> outputReader)
-
Method Summary
Modifier and Type Method Description protected intcompare(CompletedOp<D> one, CompletedOp<D> other)longgetCount()longgetMinCycle()java.util.Iterator<CycleResult>iterator()voidonFull()When a stride is complete, do house keeping.voidonOpFailure(FailedOp<D> op)voidonOpSkipped(SkippedOp<D> op)voidonOpStarted(StartedOp<D> op)voidonOpSuccess(SucceededOp<D> op)voidstart()Each strideOp opTracker must be started before any ops that it tracks-
Methods inherited from class io.engineblock.activityapi.cyclelog.buffers.Buffer
getFlippedData, put, remaining, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.engineblock.activityapi.cyclelog.buffers.results.CycleResultsSegment
compareTo, filter
-
-
-
-
Constructor Detail
-
StrideTracker
public StrideTracker(com.codahale.metrics.Timer strideServiceTimer, com.codahale.metrics.Timer strideResponseTimer, long strideWaitTime, long initialCycle, int size, Output output, StrideOutputConsumer<D> outputReader)
-
-
Method Detail
-
start
public void start()
Each strideOp opTracker must be started before any ops that it tracks
-
onOpStarted
public void onOpStarted(StartedOp<D> op)
- Specified by:
onOpStartedin interfaceOpEvents<D>
-
onOpSuccess
public void onOpSuccess(SucceededOp<D> op)
- Specified by:
onOpSuccessin interfaceOpEvents<D>
-
onOpFailure
public void onOpFailure(FailedOp<D> op)
- Specified by:
onOpFailurein interfaceOpEvents<D>
-
onOpSkipped
public void onOpSkipped(SkippedOp<D> op)
- Specified by:
onOpSkippedin interfaceOpEvents<D>
-
onFull
public void onFull()
When a stride is complete, do house keeping. This effectively means when N==stride ops have been submitted to this buffer, which is tracked byBuffer.put(Comparable).- Overrides:
onFullin classBuffer<CompletedOp<D>>
-
compare
protected int compare(CompletedOp<D> one, CompletedOp<D> other)
- Specified by:
comparein classBuffer<CompletedOp<D>>
-
getCount
public long getCount()
- Specified by:
getCountin interfaceCycleResultsSegment
-
getMinCycle
public long getMinCycle()
- Specified by:
getMinCyclein interfaceCycleResultsSegment
-
iterator
public java.util.Iterator<CycleResult> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<D>
-
-