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.
Click to show internal directories.
Click to hide internal directories.