rakyll / hey

HTTP load generator, ApacheBench (ab) replacement
Apache License 2.0
17.65k stars 1.17k forks source link

[RFC] Export request.report struct to public interface #176

Closed kenju closed 4 years ago

kenju commented 4 years ago

Background

I am writing a benchmark application server using Go. The app wants to run load testing against both gRPC/HTTP application.

It would be great if report struct becomes public interface so that we can access each data programmatically.

https://github.com/rakyll/hey/blob/22735a3bf7611499f341de944151d22fac68665c/requester/report.go#L33-L64

For example, it would be great to take any report result from the struct, add it to metrics counter (e.g. Prometheus).

Of course, I can write a CLI wrapper, but it requires too string manipulation and hard to maintain.

Disclaimer

I understand that the report class was initially designed as an implementation detail, and rakyll/hey's responsibility is to simply show simple & nice text-based graph in UTF-8.

However, as rakyll/hey is getting popular, it would be great that this library supports more flexible output for programmers who want to use the power of rakyll/hey much more.

Solution

Here are some suggestions:

Example

gRPC load testing tool, https://github.com/bojand/ghz, support

documentation is here 👉 https://godoc.org/github.com/bojand/ghz


@rakyll what do you think?