reporter

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BenchmarkExtra

type BenchmarkExtra interface {
	String() string
}

type BenchmarkReport

type BenchmarkReport struct {
	Name       string
	Runs       []*BenchmarkStatistics
	Statistics *BenchmarkStatistics
}

func NewBenchmarkReport

func NewBenchmarkReport(name string, runs ...*BenchmarkStatistics) *BenchmarkReport

type BenchmarkReporter

type BenchmarkReporter interface {
	ProduceReport(reports []*BenchmarkReport) error
}

BenchmarkReporter is the interface that is required to be implemented by any report generation tool.

type BenchmarkRun

type BenchmarkRun struct {
	Durations []time.Duration
	Extra     BenchmarkExtra
}

func NewBenchmarkRun

func NewBenchmarkRun(durations []time.Duration, extra BenchmarkExtra) *BenchmarkRun

func NewBenchmarkRunSingle

func NewBenchmarkRunSingle(duration time.Duration, extra BenchmarkExtra) *BenchmarkRun

type BenchmarkStatistics

type BenchmarkStatistics struct {
	Total        time.Duration
	Average      time.Duration
	Fastest      time.Duration
	Slowest      time.Duration
	Median       time.Duration
	Percentile90 time.Duration
	Percentile10 time.Duration
	RMS          time.Duration
	SampleCount  int
	Extra        BenchmarkExtra
}

func NewBenchmarkStatistics

func NewBenchmarkStatistics(extra BenchmarkExtra, durations ...time.Duration) *BenchmarkStatistics

func (*BenchmarkStatistics) String

func (b *BenchmarkStatistics) String() string

type JSONReporter

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

JSONReporter produces a JSON data file with all the benchmark information.

func NewJSONReporter

func NewJSONReporter(output string) *JSONReporter

func (*JSONReporter) ProduceReport

func (j *JSONReporter) ProduceReport(reports []*BenchmarkReport) error

type StdOutReporter

type StdOutReporter struct{}

StdOutReporter prints the benchmark report to os.Stdout.

func (*StdOutReporter) ProduceReport

func (*StdOutReporter) ProduceReport(reports []*BenchmarkReport) error

Jump to

Keyboard shortcuts

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