Package com.aembot.lib.tracing
Class TraceSpan
java.lang.Object
com.aembot.lib.tracing.TraceSpan
Represents a single traced span (function call) with timing information. Pre-allocated to avoid
GC during robot loop.
Memory-optimized: threadName and category are stored externally in lookup tables. FPGA timestamps are computed at export time from nanos using TraceLoop's reference point.
-
Field Summary
FieldsModifier and TypeFieldDescriptionbyteCategory index into Tracer.getCategories()booleanWhether this span has completed (endSpan was called)byteNesting depth (0 = top level, increases with nested calls)longEnd time in nanosecondsName of the traced function (ClassName.methodName or custom)longStart time in nanoseconds (System.nanoTime) for high precision durationlongThread ID that this span ran on -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleGet duration in microsecondsdoubleGet duration in millisecondsvoidreset()Reset this span for reuse
-
Field Details
-
startNanos
public long startNanosStart time in nanoseconds (System.nanoTime) for high precision duration -
endNanos
public long endNanosEnd time in nanoseconds -
name
Name of the traced function (ClassName.methodName or custom) -
depth
public byte depthNesting depth (0 = top level, increases with nested calls) -
threadId
public long threadIdThread ID that this span ran on -
categoryIndex
public byte categoryIndexCategory index into Tracer.getCategories() -
complete
public boolean completeWhether this span has completed (endSpan was called)
-
-
Constructor Details
-
TraceSpan
public TraceSpan()
-
-
Method Details
-
reset
public void reset()Reset this span for reuse -
getDurationMicros
public double getDurationMicros()Get duration in microseconds -
getDurationMillis
public double getDurationMillis()Get duration in milliseconds
-