feat(core,cli): export traces to the Open OCPP Trace format#126
Merged
Conversation
toOpenOcppTraceRecords() and toOpenOcppTraceJsonl() emit any parsed trace as Open OCPP Trace v1.1 records: raw serialized from the stored frame, response action back-filled by messageId correlation, connectorId lifted from request payloads, and trace-level ocppVersion/chargePointId supplied via options. Events the format cannot represent (no timestamp, unknown direction) are skipped with a warning rather than invented. A new CLI command, ocpp-debugkit convert <file> [--output], writes the JSONL with data on stdout and warnings on stderr, carrying trace-level metadata over from JSON Object inputs. Conformance: every exported record is validated against the vendored specification JSON Schema, and per-fixture round-trip tests prove that export-then-reparse reproduces the expected consumer view and the exact events.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Writes the vendor-neutral Open OCPP Trace interchange format from DebugKit, the producer counterpart of #124: any trace the toolkit can parse becomes a file other OCPP tools can consume.
What's in it
toOpenOcppTraceRecords()/toOpenOcppTraceJsonl()export parsed events as v1.1 records:messageIdcorrelation, so it always equals the correlated CALL's action.connectorIdlifted from request payloads; trace-levelocppVersion/chargePointIdsupplied via an options bag.ocpp-debugkit convert <file> [--output]emits the JSONL from the command line: data on stdout, warnings on stderr, and trace-level metadata carried over from JSON Object inputs.Conformance
For each of the 15 vendored fixtures: exporting the parsed events reproduces the fixture's
expected.jsonconsumer view, every exported record validates against the specification's published JSON Schema (vendored alongside the fixtures), and re-parsing the export yields the same events. The installed-package smoke test covers the new exports and a realconvertrun.Notes
Event[]plus an options bag and return{ records, warnings }, since skip-and-flag needs a warnings channel and the internal event model carries no trace-level metadata (the known scope note from feat(core): parse the Open OCPP Trace interchange format #124).Closes #122