Class TraceExporter

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

public final class TraceExporter extends Object
Exports trace data to Chrome Tracing JSON format. This format is compatible with:
  • Chrome's built-in tracing viewer (chrome://tracing)
  • Perfetto UI (https://ui.perfetto.dev)
  • Custom trace viewers
  • Method Details

    • exportToJson

      public static void exportToJson(TraceLoop[] loops, int currentIndex, int totalLoopCount, List<String> categories, Map<Long,String> threadNames, String path)
      Export all loops in the buffer to Chrome Tracing JSON format.
      Parameters:
      loops - The loop buffer
      currentIndex - Current write index in circular buffer
      totalLoopCount - Total loops recorded
      categories - Category registry for index lookup
      threadNames - Thread name cache for ID lookup
      path - Output file path
    • exportRecentToJson

      public static void exportRecentToJson(TraceLoop[] loops, int currentIndex, int numLoops, List<String> categories, Map<Long,String> cachedThreadNames, String path)
      Export the most recent N loops to Chrome Tracing JSON format.
      Parameters:
      loops - The loop buffer
      currentIndex - Current write index in circular buffer
      numLoops - Number of loops to export
      categories - Category registry for index lookup
      cachedThreadNames - Thread name cache for ID lookup
      path - Output file path