A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bencheeorg/benchee_csv below:

bencheeorg/benchee_csv: Output your Benchee benchmarks as CSV to generate graphs in your favorite spreadsheet tool!

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):

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.

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.

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:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4