1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-28 15:43:57 +03:00
Files
mvfst/quic/logging/FileQLogger.cpp
Matt Joras 88a8b48c3b Migrate mvfst qlog to IETF qlog main schema v0.4
Summary:
Migrates mvfst's qlog implementation from the legacy "draft-00" format
to the official IETF qlog main schema v0.4 specification (draft-ietf-quic-qlog-
main-schema and draft-ietf-quic-qlog-quic-events). This ensures compatibility
with standard qlog tooling and adheres to the ratified IETF format.

Key changes to the qlog structure:

1. Event format: Migrated from array format [time, category, event, data] to
   object format {time: X, name: "category:event_type", data: {...}}. Event
   names now follow the "category:event_type" convention (e.g.,
   "transport:packet_sent", "connectivity:connection_closed").

2. File structure: Updated top-level fields to include file_schema
   (urn:ietf:params:qlog:file:contained), qlog_version ("0.4"),
   serialization_format ("application/qlog+json"), and proper event_schemas
   array. Added summary field with max_duration, total_event_count, and
   trace_count.

3. Common fields: Restructured common_fields to follow IETF spec with ODCID,
   scid, protocol_type, reference_time ("0"), time_format ("relative"), and
   time_units ("microseconds").

4. Vantage point: Changed from name-based to type-based representation
   ({"type": "client"} or {"type": "server"}).

5. Streaming support: Updated finishStream() to properly inject the summary
   field before the final closing brace for both pretty and non-pretty JSON
   formats. Non-pretty JSON is handled as single-line output.

Implementation spans QLoggerTypes.cpp (event name mappings), FileQLogger.cpp
(summary generation and streaming), and updated test expectations throughout
QLoggerTest.cpp to validate the new format.

Reviewed By: sharmafb

Differential Revision: D86882919

fbshipit-source-id: bad3cf3667ce0a3ad8de207bb3a67a7bc5404a2b
2025-11-25 04:42:58 -08:00

20 KiB