benchmarking

package
v0.0.0-...-2208570 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: BSD-2-Clause Imports: 2 Imported by: 0

README

benchmarking

This is a Golang library for writing Fuchsia benchmarks that run on CI and whose results are uploaded to the Performance Dashboard.

Documentation

Index

Constants

View Source
const (
	// Time-based units.
	Nanoseconds  Unit = "nanoseconds"
	Milliseconds      = "milliseconds"

	// Size-based units.
	Bytes          = "bytes"
	BytesPerSecond = "bytes/second"

	// Frequency-based units.
	FramesPerSecond = "frames/second"

	// Percentage-based units.
	Percent = "percent"

	// Count-based units.
	Count = "count"
)

The set of valid Unit constants.

This should be kept in sync with the list of supported units in the results schema docs linked at the top of this file.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestCaseResults

type TestCaseResults struct {
	Label     string    `json:"label"`
	TestSuite string    `json:"test_suite"`
	Unit      Unit      `json:"unit"`
	Values    []float64 `json:"values"`
}

TestCaseResults represents the results for a single test case.

See the link at the top of this file for documentation.

type TestResultsFile

type TestResultsFile []*TestCaseResults

TestResultsFile represents the results produced by individual benchmarks.

Example usage:

results := new(TestResultsFile)
results.Add(&TestCaseResults{
    Label: "test case",
    TestSuite: "test suite",
    Unit:  Nanoseconds,
    Values: []float64{100, 200, 300},
})

_ := results.Encode(outputFile)

func DecodeTestResultsFile

func DecodeTestResultsFile(js []byte) (*TestResultsFile, error)

DecodeTestResultsFile parses a TestResultsFile from the input.

func (*TestResultsFile) Add

func (f *TestResultsFile) Add(results *TestCaseResults)

Add a TestCaseResults entry to the file.

func (*TestResultsFile) Encode

func (f *TestResultsFile) Encode(w io.Writer) error

Encode writes the results file as JSON to the given io.Writer.

type Unit

type Unit string

Unit represents the units of a test's measured values.

Jump to

Keyboard shortcuts

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