Documentation ¶
Overview ¶
Package benchfmt provides readers and writers for the Go benchmark format.
The format is documented at https://golang.org/design/14313-benchmark-format
This package only parses file configuration lines, not benchmark result lines. Parsing the result lines is left to the caller.
Deprecated: See the github.com/sarthak-nference/perf/benchfmt package, which implements readers and writers for the full Go benchmark format. It is also higher performance.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Labels ¶
Labels is a set of key-value strings.
func (Labels) Copy ¶
Copy returns a new copy of the labels map, to protect against future modifications to labels.
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
A Printer prints a sequence of benchmark results.
func NewPrinter ¶
NewPrinter constructs a BenchmarkPrinter writing to w.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader reads benchmark results from an io.Reader. Use Next to advance through the results.
br := benchfmt.NewReader(r) for br.Next() { res := br.Result() ... } err = br.Err() // get any error encountered during iteration ...
func (*Reader) AddLabels ¶
AddLabels adds additional labels as if they had been read from the header of a file. It must be called before the first call to r.Next.
type Result ¶
type Result struct { // Labels is the set of persistent labels that apply to the result. // Labels must not be modified. Labels Labels // NameLabels is the set of ephemeral labels that were parsed // from the benchmark name/line. // NameLabels must not be modified. NameLabels Labels // LineNum is the line number on which the result was found LineNum int // Content is the verbatim input line of the benchmark file, beginning with the string "Benchmark". Content string }
Result represents a single line from a benchmark file. All information about that line is self-contained in the Result. A Result is immutable once created.
func (*Result) SameLabels ¶
SameLabels reports whether r and b have the same labels.