-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Customizing or hiding Benchmark.ips
's output format
#14738
Comments
I slightly question the exposure of raw That said it would be really cool if it were easier to export it to hdr histogram format so that it can be put into plotter . |
|
I like the reporter pattern. It enables different formats. |
Benchmark.ips
always prints its result toSTDOUT
in a nicely formatted table:But often I want to use those numbers somewhere else, e.g. plotting a graph, and to avoid parsing the above table again, I take the returned
Benchmark::IPS::Job
(the docs don't really mention this) and post-process the items into a JSON:IMO this is still not straightforward enough, because I don't want to pollute
STDOUT
at all. It would be nice ifBenchmark.ips
itself supports those alternative formats out of the box. So I suggest implementing any of the following:Benchmark::IPS::Job#execute
and#report
, respectively.IO
toBenchmark.ips
and perform all the printing on thatIO
. Then one can passFile.open(File::NULL, "w")
or a custom no-opIO
to suppress the output.TableReporter
andMyJsonReporter
are both testable in isolation, without needing to mock a full benchmark run.Similar points probably hold for
Benchmark.bm
as well.The text was updated successfully, but these errors were encountered: