Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoBenchmarksProvided = errors.New("could not render benchmarks - no benchmarks provided") ErrUnknownRenderType = errors.New("unknown render type") ErrCouldNotParseLine = errors.New("could not parse benchmark line") ErrUnknownDimensionType = errors.New("unknown render dimension type") )
Functions ¶
Types ¶
type BenchmarkSets ¶
BenchmarkSets represents a number of benchmarks, grouped by the parent benchmark.
func ReadAndSeparateBenchmarks ¶
func ReadAndSeparateBenchmarks(reader io.Reader) (BenchmarkSets, error)
ReadAndSeparateBenchmarks reads benchmarks from the provided reader, and groups them by benchmark name (which is split from sub-benchmark names). If the operation did not succeed, an error is returned.
type CSVRenderer ¶
type CSVRenderer struct { }
func (*CSVRenderer) Render ¶
func (c *CSVRenderer) Render(writer io.Writer, parentBenchmark string, dimension RenderDimension, benchmarks []parse.Benchmark) error
type JSONRenderer ¶
type JSONRenderer struct { }
func (*JSONRenderer) Render ¶
func (j *JSONRenderer) Render(writer io.Writer, parentBenchmark string, dimension RenderDimension, benchmarks []parse.Benchmark) error
type RasterRenderer ¶
type RasterRenderer struct { Title string Height int BarWidth int RenderType RenderType // contains filtered or unexported fields }
RasterRenderer outputs a raster graphic based representation of the benchmarks, compared against one another.
func NewRasterRenderer ¶
func NewRasterRenderer(title string, renderType RenderType) *RasterRenderer
func (*RasterRenderer) Render ¶
func (r *RasterRenderer) Render(writer io.Writer, parentBenchmark string, renderDimension RenderDimension, benchmarks []parse.Benchmark) error
type RenderDimension ¶
type RenderDimension int
const ( RenderNsPerOp RenderDimension = iota RenderBytesPerOp RenderAllocsPerOp )
func RenderDimensionFromString ¶
func RenderDimensionFromString(str string) (RenderDimension, error)
func (RenderDimension) String ¶
func (r RenderDimension) String() string
type RenderType ¶
type RenderType int
const ( PNG RenderType = iota SVG JSON CSV XML )
func RenderTypeFromString ¶
func RenderTypeFromString(str string) (RenderType, error)
func (RenderType) FileExtension ¶
func (r RenderType) FileExtension() string
func (RenderType) Renderer ¶
func (r RenderType) Renderer(title string) (Renderer, error)
Renderer provides an instance of a Renderer for the RenderType - for instance, a JSONRenderer for JSON. If there is no matching Renderer for the RenderType, an ErrUnknownRenderType is returned.
func (RenderType) String ¶
func (r RenderType) String() string
type XMLRenderer ¶
type XMLRenderer struct { }
func (*XMLRenderer) Render ¶
func (x *XMLRenderer) Render(writer io.Writer, parentBenchmark string, dimension RenderDimension, benchmarks []parse.Benchmark) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.