Class TraceLoop

java.lang.Object
com.aembot.lib.tracing.TraceLoop

public final class TraceLoop extends Object
Container for all trace spans within a single robot loop iteration. Pre-allocated to avoid GC during robot loop.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    double
    FPGA timestamp when this loop ended
    int
    Loop number (incrementing counter)
    static final int
    Maximum number of spans per loop (256 to accommodate command tracing)
    int
    Current number of active spans in this loop
    final TraceSpan[]
    Pre-allocated array of spans
    long
    System.nanoTime() when this loop started (for computing span FPGA times)
    double
    FPGA timestamp when this loop started
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new loop with pre-allocated spans
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Get total loop duration in milliseconds
    void
    Reset this loop for reuse

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MAX_SPANS

      public static final int MAX_SPANS
      Maximum number of spans per loop (256 to accommodate command tracing)
      See Also:
    • spans

      public final TraceSpan[] spans
      Pre-allocated array of spans
    • spanCount

      public int spanCount
      Current number of active spans in this loop
    • loopNumber

      public int loopNumber
      Loop number (incrementing counter)
    • startTime

      public double startTime
      FPGA timestamp when this loop started
    • endTime

      public double endTime
      FPGA timestamp when this loop ended
    • startNanos

      public long startNanos
      System.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