Skip to content

Commit

Permalink
Update Saving-and-Replaying-from-file.md
Browse files Browse the repository at this point in the history
Addition due to #1234 feedbacks.
Description for latency borrowed from https://github.com/buger/goreplay/blob/master/middleware/README.md?plain=1#L39C13-L40
  • Loading branch information
ThomasG77 authored Mar 19, 2024
1 parent 21b8387 commit 45ee547
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/Saving-and-Replaying-from-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,16 @@ To read or write GZIP compressed files ensure that file extension ends with ".gz
Gor has memory buffer when it writes to file, and continuously flush changes to the file. Flushing to file happens if the buffer is filled, forced flush every 1 second, or if Gor is closed. You can change it using `--output-file-flush-interval` option. It most cases it should not be touched.

### File format
HTTP requests stored as it is, plain text: headers and bodies. Requests separated by `\n🐵🙈🙉\n` line (using such sequence for uniqueness and fun). Before each request goes single line with meta information containing payload type (1 - request, 2 - response, 3 - replayed response), unique request ID (request and response have the same) and timestamp when request was made. An example of 2 requests:
HTTP requests stored as it is, plain text: headers and bodies. Requests separated by `\n🐵🙈🙉\n` line (using such sequence for uniqueness and fun). Before each request goes single line with meta information containing payload type (1 - request, 2 - response, 3 - replayed response), unique request ID (request and response have the same), timestamp when request was made (in nanoseconds) and latency (time difference between request start and finish. For `request` is always zero). An example of 2 requests:

```
1 d7123dasd913jfd21312dasdhas31 127345969\n
1 d7123dasd913jfd21312dasdhas31 1710781031501207115 0\n
GET / HTTP/1.1\r\n
\r\n
\n
🐵🙈🙉
\n
1 a1ba0050a213128487cd25db 1710781031551256751 0\n
POST /upload HTTP/1.1\r\n
Content-Length: 7\r\n
Host: www.w3.org\r\n
Expand All @@ -102,4 +103,4 @@ You can loop the same set of files, so when the last one replays all the request
Pass `--input-file-loop` to make it work.

***
You may also read about [[Capturing and replaying traffic]] and [[Rate limiting]]
You may also read about [[Capturing and replaying traffic]] and [[Rate limiting]]

0 comments on commit 45ee547

Please sign in to comment.