parse

package
v0.0.0-...-c9cfaf6 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package parse implements a parser for the Go benchmark format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	Results []*Result
	Errors  []*Error
}

Collection of results from parsing benchmark output.

func Bytes

func Bytes(b []byte) (*Collection, error)

Bytes parses results from b.

func Reader

func Reader(r io.Reader) (*Collection, error)

Reader parses results from the supplied reader.

type Error

type Error struct {
	Line    int
	Content string
	Reason  string
}

Error represents a single benchmark line that failed to parse.

func (*Error) Error

func (e *Error) Error() string

type Result

type Result struct {
	// FullName is the complete name of the benchmark, including parameters.
	FullName string
	// Name of the benchmark, excluding parameters and the "Benchmark" prefix.
	Name string
	// Parameters of the benchmark, extracted from the name.
	Parameters map[string]string
	// Labels are the persistent labels that applied to the result.
	Labels map[string]string
	// Iterations.
	Iterations uint64
	// Value measured by the benchmark.
	Value float64
	// Unit of the measured value.
	Unit string
	// Line number on which the result was found.
	Line int
}

Result is a benchmark result.

Jump to

Keyboard shortcuts

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