reorx / httpstat

curl statistics made simple
MIT License
5.94k stars 384 forks source link

Add flag which does not store response body #4

Closed akshaychhajed closed 7 years ago

akshaychhajed commented 8 years ago

Currently, the app stores the response body in tmp. The new flag to support quick scan to look for metrics but not interested in keeping any output around. This would be a great feature. It would be even better if it does all operations in memory instead of using temp files and deleting them later.

reorx commented 8 years ago

The new flag to support quick scan to look for metrics but not interested in keeping any output around.

This is reasonable, there should be a flag to control whether to store body in file or not

It would be even better if it does all operations in memory instead of using temp files and deleting them later.

Currently impossible to achieve that, httpstat is just a wrapper for calling curl command, and since it has used -w, --write-out option, body could only be get from file that passed to -o, --output, that's why the temp file has to be created, but we can decide whether to delete it by the flag you mentioned. If you find any way to get the body without touching the file, please tell me :)

I'm considering naming the flag HTTPSTAT_SAVE_BODY, if value is true, the temp file that stores body will be kept, otherwise it will be deleted after reading.

reorx commented 7 years ago

Implemented in the latest version.