Package com.aembot.lib.tracing
Class TraceLoop
java.lang.Object
com.aembot.lib.tracing.TraceLoop
Container for all trace spans within a single robot loop iteration. Pre-allocated to avoid GC
during robot loop.
-
Field Summary
FieldsModifier and TypeFieldDescriptiondoubleFPGA timestamp when this loop endedintLoop number (incrementing counter)static final intMaximum number of spans per loop (256 to accommodate command tracing)intCurrent number of active spans in this loopfinal TraceSpan[]Pre-allocated array of spanslongSystem.nanoTime() when this loop started (for computing span FPGA times)doubleFPGA timestamp when this loop started -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleGet total loop duration in millisecondsvoidreset()Reset this loop for reuse
-
Field Details
-
MAX_SPANS
public static final int MAX_SPANSMaximum number of spans per loop (256 to accommodate command tracing)- See Also:
-
spans
Pre-allocated array of spans -
spanCount
public int spanCountCurrent number of active spans in this loop -
loopNumber
public int loopNumberLoop number (incrementing counter) -
startTime
public double startTimeFPGA timestamp when this loop started -
endTime
public double endTimeFPGA timestamp when this loop ended -
startNanos
public long startNanosSystem.nanoTime() when this loop started (for computing span FPGA times)
-
-
Constructor Details
-
TraceLoop
public TraceLoop()Create a new loop with pre-allocated spans
-
-
Method Details
-
reset
public void reset()Reset this loop for reuse -
getDurationMillis
public double getDurationMillis()Get total loop duration in milliseconds
-