support HAR exporter (http) layer in rama #357
Labels
easy
An easy issue to pick up for anyone.
good first issue
Good for newcomers
mentor available
A mentor is available to help you through the issue.
Milestone
HAR File wikipedia: https://en.wikipedia.org/wiki/HAR_(file_format)
Only official looking doc I could find was https://w3c.github.io/web-performance/specs/HAR/Overview.html
Goal of this issue is to support Recording and exporting of HAR files,
of course it doesn't have to be a file to which we export,
but in the most common use case it will be.
This feature can be used by:
Requirements
har
to https://github.com/plabayo/rama/tree/main/rama-http/src/layer where:HARExportService
andHARExportLayer
.Both service and layer will take the following input:
FnOnce + Clone
? Used to create a future (signal) to toggle between record and stop, where on stop the data is exportedThe service starts in stopped modus (== not active) and is to be activated once signal is true, this can be spawned (gracefully) as a task really where the service just keeps track of an AtomicBool. Important is that that background tasks does exit in case the context is cancelled.
When the service is in record mode it will need to buffer each incoming http request in a prepared manner, har-ready.
This data can be kept already in a custom struct format (with these structs being
serde::Serialize+Deserialize
).When the toggle stops the record it will need to serialize the buffer as a json blob and write it to the Writer, which is basically just an ascyn io writer.
Required input for the Service/Layer:
Custom options for the service/layer:
This feature should also be well unit tested.
We also require an Example file which inspects the har file exists and is valid (can be as basic as just verifying the default format, not need to have 100% fail proof test. If the file exists, and it is a valid json object, which contains the expected root object and entries, where one entry can be verified a bit more in depth, it is probably good enough for what that e2e example test is concerned.
The text was updated successfully, but these errors were encountered: