mirror of
https://github.com/gravitational/teleport.git
synced 2026-11-02 23:31:08 +08:00
* audit: optimize JSON marshaling operations when reading unstructured events Reduce the number of JSON marshal/unmarshal operations in GetUnstructuredEvents to improve performance when reading audit logs from Teleport. Previously, reading unstructured events involved 6 operations: 1. Read data from backend 2. JSON unmarshal to events.EventFields 3. Marshal to JSON 4. JSON unmarshal to events satisfying apievents.AuditEvent 5. Marshal to JSON 6. Protojson unmarshal to structpb.Struct This optimization reduces the process to 3 operations: 1. Read data from backend 2. JSON unmarshal to events.EventFields 3. Direct conversion using structpb.NewStruct(fields) This change minimizes JSON marshal/unmarshal overhead while maintaining unchanged the non-unstructured endpoints (steps 1-4 remain unchanged). * prevent returning non-nil error and nextKey