Skip to content
Output your Benchee benchmarks as CSV to generate graphs in your favorite spreadsheet tool!
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config Initial skeletion Jun 5, 2016
lib/benchee/formatters Update & adapt to new benchee version Mar 17, 2019
samples
test Test to ascertain that we don't crash if nothing is collected (#20) Feb 10, 2019
.formatter.exs Format everything (#16) Nov 23, 2018
.gitignore
.tool-versions newer elixir and erlang Mar 28, 2019
.travis.yml hmm upgrades (#24) Mar 26, 2019
CHANGELOG.md ah changelog Mar 28, 2019
CODE_OF_CONDUCT.md
LICENSE.md Add MIT License (as in Benchee itself) Jun 5, 2016
README.md 1.0 Apr 10, 2019
mix.exs point to released elixir Mar 28, 2019
mix.lock benchee 1.0 Mar 28, 2019
run_samples.sh Adjustments for changes in benchee 0.8.0 May 3, 2017

README.md

benchee_csv Hex Version docs Build Status Coverage Status

Formatter for benchee to turn the statistics output into a CSV file. This can then be used in the Spreadsheet tool of your choice to generate graphs to your liking.

These might then look like this one (quickly generated with LibreOffice from the output of the sample):

sample graphs

Installation

Add benchee_csv to your list of dependencies in mix.exs:

def deps do
  [{:benchee_csv, "~> 1.0", only: :dev}]
end

Afterwards, run mix deps.get to install it.

Usage

Simply configure Benchee.Formatters.CSV as one of the formatters for Benchee.run/2 along with the file path you want the output to go (otherwise defaults to "benchmark_output.csv"):

list = Enum.to_list(1..10_000)
map_fun = fn i -> [i, i * i] end

Benchee.run(
  %{
    "flat_map" => fn -> Enum.flat_map(list, map_fun) end,
    "map.flatten" => fn -> list |> Enum.map(map_fun) |> List.flatten() end
  },
  formatters: [
    {Benchee.Formatters.CSV, file: "my.csv"},
    Benchee.Formatters.Console
  ]

The sample defines both the standard console formatter and the CSV formatter, if you don't care about the console output you can just delet that line.

You can also use the more verbose and versatile API of Benchee. When it comes to formatting just use Benchee.Formatters.CSV.format/2 and then write it to a file (taking into account the new input structure). Check out the samples directory for the verbose samples to see how it's done.

Contributing

Contributions to benchee_csv are very welcome! Bug reports, documentation, spelling corrections, whole features, feature ideas, bugfixes, new plugins, fancy graphics... all of those (and probably more) are much appreciated contributions!

Please respect the Code of Conduct.

You can get started with a look at the open issues.

A couple of (hopefully) helpful points:

  • Feel free to ask for help and guidance on an issue/PR ("How can I implement this?", "How could I test this?", ...)
  • Feel free to open early/not yet complete pull requests to get some early feedback
  • When in doubt if something is a good idea open an issue first to discuss it
  • In case I don't respond feel free to bump the issue/PR or ping me on other places

Development

  • mix deps.get to install dependencies
  • mix test to run tests
  • mix credo or mix credo --strict to find code style problems (not too strict with the 80 width limit for sample output in the docs)
You can’t perform that action at this time.