Interface QlogSink

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface QlogSink
Receives qlog-style connection events, for debugging: packets sent, received and lost, recovery metrics, key updates and state changes. Event names follow the qlog schema ( transport:packet_sent, recovery:packet_lost, ...); the data is a small JSON object.

Implementations must be thread-safe: connections report from their own threads. Events are only built when a sink is configured, so an absent sink costs nothing.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    event(String connection, long timeNanos, String name, String data)
    Records one event.
    static QlogSink
    A sink that writes each event as one JSON line to a System.Logger at DEBUG.
  • Method Details

    • event

      void event(String connection, long timeNanos, String name, String data)
      Records one event.
      Parameters:
      connection - the connection's original Destination Connection ID, in hexadecimal
      timeNanos - the time of the event on the connection's clock
      name - the qlog event name, such as transport:packet_sent
      data - the event data as a JSON object
    • logger

      static QlogSink logger(System.Logger logger)
      A sink that writes each event as one JSON line to a System.Logger at DEBUG.
      Parameters:
      logger - the logger
      Returns:
      the sink