Generating HTML output from criterion

坚强是说给别人听的谎言 提交于 2020-02-01 01:39:22

问题


There is a nice example of HTML output from criterion at http://bos.github.com/criterion/.

Which command line option is used to generate this output?

An answer to a related question asserts that this output exits, but it does not seem to show up in the command line options when using --help.


回答1:


Well if you just want html output, then yourBench -o yourReport.html will generate some perfectly reasonable output. If you want to use your own template, look at the templates/report.tpl example in the distribution and use the -t option.




回答2:


Sorry I didn't get around to your comment-question.

The answer Jedai gives is right - just use -o. For example, here is a line from one of my Makefiles for running benchmarks using defaultMain from Criterion:

./Bench -g -u Bench.csv -o Bench.html -s $(SAMPLES)

Breaking that down, it says:

-g    run GC between each sample
-u    output CSV data to the given file
-o    output HTML data to the given file
-s    collect this many samples



回答3:


It seems to me that you just pass the template as a command line option, and then it populates it. If the template happens to be an html template, then you've generated html.

See the source here: https://github.com/bos/criterion



来源:https://stackoverflow.com/questions/9741167/generating-html-output-from-criterion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!