Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--output-file-max-size-limit with compressed .gz file #775

Closed
xiaofud opened this issue Jun 20, 2020 · 1 comment · Fixed by #777
Closed

--output-file-max-size-limit with compressed .gz file #775

xiaofud opened this issue Jun 20, 2020 · 1 comment · Fixed by #777
Labels
bug Something isn't working help wanted

Comments

@xiaofud
Copy link

xiaofud commented Jun 20, 2020

Hi, I tested with

sudo gor --input-raw :8080 --output-file=/tmp/gor/requests.txt.gz --output-file-max-size-limit 1m --output-file-append

Gor exited when the file /tmp/gor/requests.txt.gz reached 152KB. It seems the --output-file-max-size-limit option applies to the decompressed file instead of the gz file. Is there any way for this option to apply to the compressed file?

@buger buger added bug Something isn't working help wanted labels Jun 22, 2020
@buger
Copy link
Owner

buger commented Jun 22, 2020

Hi! Indeed it looks like a bug.

I checked the code, and issue is on this line 231:

goreplay/output_file.go

Lines 228 to 232 in 3dff071

o.writer.Write(data)
o.writer.Write([]byte(payloadSeparator))
o.totalFileSize += int64(len(data) + len(payloadSeparator))
o.queueLength++

Instead of incrementing by direct bytes, it should read "n" argument from the "Write" operation, and use it.

slimus referenced this issue in slimus/goreplay Jun 23, 2020
buger pushed a commit that referenced this issue Jun 23, 2020
Fix #775 

When we are using .gz for output we are counting incorrect file size. Now it should be ok
xingren23 referenced this issue in xingren23/goreplay Sep 4, 2021
Fix #775 

When we are using .gz for output we are counting incorrect file size. Now it should be ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants