benchplot

module
v0.0.0-...-0fb5f28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2020 License: MIT

README

benchplot

This is a tool to plot the results of go benchmarks. It assumes that each sub-benchmark is named as var_name=var_value. The input is the output of a go benchmark.

Usage

benchplot -bench ${bench} -x ${x_var} ${FILE} Where ${FILE} is the path to a file containing the output of a go benchmark (if empty or "-" stdin is used), ${bench} is the name of the benchmark to plot, and ${x_var} is the name of the variable to use for the x-axis of the plot.

Full flag set:

  -bench string
    	The name of the benchmark to plot
  -filter-by value
    	Expressions to filter results by. Form: 'var_name==var_value'. Available comparison operations: ["==" "!=" "<" ">" "<=" ">="]
  -group-by value
    	The variables to group results by (an input to the benchmark)
  -h	Show this help message and exit
  -height float
    	The height of the output figure (default 500)
  -left-legend
    	Display legend on left edge of plot (default is on right edge)
  -o string
    	The output file name with extension (if empty will be set to ${bench}.png)
  -plots value
    	The plots to generate (options = ["scatter" "avg_line"]). If empty will default to ["scatter" "avg_line"] for numeric data
  -top-legend
    	Display legend on top edge of plot (default is on bottom edge)
  -width float
    	The width of the output figure (default 500)
  -x string
    	The name of the x-axis variable (an input to the benchmark)
  -y string
    	The name of the y-axis variable (default "time")

Examples

Plotting the results of BenchmarkGroupResults (in benchmark_test.go of benchparse repo):

go test ./benchmark -run ! -bench BenchmarkGroupResults -count 3 -race | benchplot -bench BenchmarkGroupResults -group-by group_by_count -x num_results

benchgroupres

Next Steps

Right now the main focus is bringing the feature set to parity with my initial implementation of this tool which used Python and matplotlib. This includes supporting bar charts (which would be the default if the provided ${x_var} had non-numeric data) and filtering of data.

Directories

Path Synopsis
cmd
benchplot command
Package gonum contains a Plotter implementation using the gonum/plot package(https://godoc.org/gonum.org/v1/plot).
Package gonum contains a Plotter implementation using the gonum/plot package(https://godoc.org/gonum.org/v1/plot).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL