Package com.aembot.lib.tracing
Class TraceExporter
java.lang.Object
com.aembot.lib.tracing.TraceExporter
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 Summary
Modifier and TypeMethodDescriptionstatic voidexportRecentToJson(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.static voidexportToJson(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.
-
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 buffercurrentIndex- Current write index in circular buffertotalLoopCount- Total loops recordedcategories- Category registry for index lookupthreadNames- Thread name cache for ID lookuppath- 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 buffercurrentIndex- Current write index in circular buffernumLoops- Number of loops to exportcategories- Category registry for index lookupcachedThreadNames- Thread name cache for ID lookuppath- Output file path
-