Class CopilotTimingLog

java.lang.Object
com.vaadin.copilot.CopilotTimingLog

public final class CopilotTimingLog extends Object
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().

  • Method Details

    • log

      public static void log(String message)
      Records a timing marker. No-op unless Copilot is running in development mode.
      Parameters:
      message - the marker text
    • getEntries

      public static List<CopilotTimingLog.Entry> 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