Package com.vaadin.copilot
Class CopilotTimingLog
java.lang.Object
com.vaadin.copilot.CopilotTimingLog
In-memory ring buffer for Copilot startup/connection timing markers.
This is diagnostic scaffolding for investigating rare, intermittent slow
loads that cannot be reproduced on demand. Markers are collected only when
Copilot is running in development mode (Copilot.isDevelopmentMode()),
so a slow load that already happened can be inspected afterwards without
having to flip any per-logger flags first.
The frontend counterpart lives in shared/copilot-timing-log.ts; the
collected server-side entries are exposed to the browser via
TimingLogsHandler and can be read from the console with
window.Vaadin.copilot.dumpTimingLogs().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA single timing marker. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<CopilotTimingLog.Entry> Returns a snapshot of the collected markers, oldest first.static voidRecords a timing marker.static tools.jackson.databind.node.ArrayNodetoJson()Serializes the collected markers as a JSON array of{time, elapsedTime, message}objects.
-
Method Details
-
log
Records a timing marker. No-op unless Copilot is running in development mode.- Parameters:
message- the marker text
-
getEntries
Returns a snapshot of the collected markers, oldest first.- Returns:
- the collected markers
-
toJson
public static tools.jackson.databind.node.ArrayNode toJson()Serializes the collected markers as a JSON array of{time, elapsedTime, message}objects.- Returns:
- the markers as JSON
-