gobenchdata: github.com/bobheadxi/gobenchdata/bench Index | Files

package bench

import "github.com/bobheadxi/gobenchdata/bench"

Package bench provides benchmark output parsing capabilities.

Index

Package Files

benchmark.go doc.go parser.go

type Benchmark Uses

type Benchmark struct {
    Name string
    Runs int

    NsPerOp float64
    Mem     Mem                // from '-benchmem'
    Custom  map[string]float64 `json:",omitempty"` // https://tip.golang.org/pkg/testing/#B.ReportMetric
}

Benchmark is an individual run

type Mem Uses

type Mem struct {
    BytesPerOp  int
    AllocsPerOp int
}

Mem is memory allocation information about a run

type Parser Uses

type Parser struct {
    // contains filtered or unexported fields
}

Parser is gobenchdata's benchmark output parser

func NewParser Uses

func NewParser(in *bufio.Reader) *Parser

NewParser instantiates a new benchmark parser that reads from the given buffer

func (*Parser) Read Uses

func (p *Parser) Read() ([]Suite, error)

type Run Uses

type Run struct {
    Version string `json:",omitempty"`
    Date    int64
    Tags    []string `json:",omitempty"`
    Suites  []Suite
}

Run denotes one run of gobenchdata, useful for grouping benchmark records

type RunHistory Uses

type RunHistory []Run

RunHistory is a sort.Interface that sorts the most recent run first

func (RunHistory) Len Uses

func (r RunHistory) Len() int

func (RunHistory) Less Uses

func (r RunHistory) Less(i, j int) bool

func (RunHistory) Runs Uses

func (r RunHistory) Runs() []Run

Runs returns the underlyinng runs

func (RunHistory) Swap Uses

func (r RunHistory) Swap(i, j int)

type Suite Uses

type Suite struct {
    Goos       string
    Goarch     string
    Pkg        string
    Benchmarks []Benchmark
}

Suite is a suite of benchmark runs

Package bench imports 6 packages (graph). Updated 2019-10-14. Refresh now. Tools for package owners.