benchstatter

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Overview

Package benchstatter is used to run benchstatter programmatically

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCollectionFiles

func AddCollectionFiles(c *benchstat.Collection, files ...string) error

AddCollectionFiles adds files to a collection

func FormatMarkdown added in v0.5.2

func FormatMarkdown(w io.Writer, tables []*benchstat.Table, opts *MarkdownFormatterOptions) error

FormatMarkdown formats benchstat output as markdown

Types

type Benchstat

type Benchstat struct {
	// DeltaTest is the test to use to decide if a change is significant.
	// If nil, it defaults to UTest.
	DeltaTest benchstat.DeltaTest

	// Alpha is the p-value cutoff to report a change as significant.
	// If zero, it defaults to 0.05.
	Alpha float64

	// AddGeoMean specifies whether to add a line to the table
	// showing the geometric mean of all the benchmark results.
	AddGeoMean bool

	// SplitBy specifies the labels to split results by.
	// By default, results will only be split by full name.
	SplitBy []string

	// Order specifies the row display order for this table.
	// If Order is nil, the table rows are printed in order of
	// first appearance in the input.
	Order benchstat.Order

	// ReverseOrder reverses the display order. Not valid if Order is nil.
	ReverseOrder bool

	// OutputFormatter determines how the output will be formatted. Default is TextFormatter
	OutputFormatter OutputFormatter
}

Benchstat is a benchstat runner

func (*Benchstat) Collection

func (b *Benchstat) Collection() *benchstat.Collection

Collection returns a *benchstat.Collection

func (*Benchstat) OutputTables

func (b *Benchstat) OutputTables(writer io.Writer, tables []*benchstat.Table) error

OutputTables outputs the results from tables using b.OutputFormatter

func (*Benchstat) Run

func (b *Benchstat) Run(files ...string) (*benchstat.Collection, error)

Run runs benchstat

type CSVFormatterOptions

type CSVFormatterOptions struct {
	NoRange bool
}

CSVFormatterOptions options for a csv OutputFormatter

type HTMLFormatterOptions

type HTMLFormatterOptions struct {
	Header string
	Footer string
}

HTMLFormatterOptions options for an html OutputFormatter

type MarkdownFormatterOptions added in v0.4.0

type MarkdownFormatterOptions struct {
	CSVFormatterOptions
}

MarkdownFormatterOptions options for a markdown OutputFormatter

type OutputFormatter

type OutputFormatter func(w io.Writer, tables []*benchstat.Table) error

OutputFormatter formats benchstat output

func CSVFormatter

func CSVFormatter(opts *CSVFormatterOptions) OutputFormatter

CSVFormatter returns a csv OutputFormatter

func HTMLFormatter

func HTMLFormatter(opts *HTMLFormatterOptions) OutputFormatter

HTMLFormatter return an html OutputFormatter

func MarkdownFormatter added in v0.4.0

func MarkdownFormatter(opts *MarkdownFormatterOptions) OutputFormatter

MarkdownFormatter return a markdown OutputFormatter

func TextFormatter

func TextFormatter(_ *TextFormatterOptions) OutputFormatter

TextFormatter returns a text OutputFormatter

type TextFormatterOptions

type TextFormatterOptions struct{}

TextFormatterOptions options for a text OutputFormatter

Jump to

Keyboard shortcuts

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