Documentation
¶
Index ¶
Constants ¶
const ( ErrorLineUnrecognized = "the line format was unrecognized" ErrorLineMalformed = "the format of the line is malformed" // GeneralBenchmark are results that fits with the generalBenchTypeRegExpr regular expression. GeneralBenchmark = microType("general") )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BenchmarkId ¶
BenchmarkId represents the identification of a microbenchmark.
func NewBenchmarkId ¶
func NewBenchmarkId(pkgName string, name string, subBenchmarkName string) *BenchmarkId
NewBenchmarkId creates a new BenchmarkId.
type Comparison ¶
type Comparison struct { BenchmarkId Right, Left Result // Difference between Right and Left. Diff Result }
Comparison allows comparison of two Result that share the same BenchmarkId.
type ComparisonArray ¶
type ComparisonArray []Comparison
func Compare ¶
Compare takes in 3 arguments, the database, and 2 SHAs. It reads from the database, the microbenchmark results for the 2 SHAs and compares them. The result is a comparison array.
func MergeDetails ¶
func MergeDetails(rightMbd, leftMbd DetailsArray) (compareMbs ComparisonArray)
MergeDetails merges two DetailsArray into a single ComparisonArray.
func (ComparisonArray) Regression ¶
func (microsMatrix ComparisonArray) Regression() (reason string)
Regression returns a string containing the reason of the regression of the given ComparisonArray, if no regression was evaluated, the reason will be an empty string. The format of a single benchmark regression's reason is like this:
"- {pkg name}/{benchmark name} decreased by {decrease percentage}%\n"
type Config ¶
type Config struct { // RootDir is the root path from where micro benchmarks will // be executed. RootDir string // Package we want to microbenchmark. Package string // Output file on which to print the intermediate results. Output string // DatabaseConfig used to save results to SQL. If this field // is nil, saving results will be skipped and no error will // be returned. DatabaseConfig *psdb.Config // contains filtered or unexported fields }
func (*Config) AddToCommand ¶
type Details ¶
type Details struct { BenchmarkId GitRef string StartedAt string Result Result }
Details refers to a single microbenchmark.
func NewDetails ¶
func NewDetails(benchmarkId BenchmarkId, gitRef string, startedAt string, result Result) *Details
NewDetails creates a new Details.
type DetailsArray ¶
type DetailsArray []Details
func GetLatestResultsFor ¶
func GetLatestResultsFor(name, subBenchmarkName string, count int, client storage.SQLClient) (mrs DetailsArray, err error)
GetLatestResultsFor will fetch and return a DetailsArray containing all the Details linked to latest runs of the given benchmark name.
func GetResultsForGitRef ¶
func GetResultsForGitRef(ref string, client storage.SQLClient) (mrs DetailsArray, err error)
GetResultsForGitRef will fetch and return a DetailsArray containing all the Details linked to the given git commit SHA.
func (DetailsArray) ReduceSimpleMedianByGitRef ¶
func (mbd DetailsArray) ReduceSimpleMedianByGitRef() (reduceMbd DetailsArray)
ReduceSimpleMedianByGitRef reduces a DetailsArray by merging all Details with the same git ref into a single one. The results of each Details correspond to the median of the merged elements.
func (DetailsArray) ReduceSimpleMedianByName ¶
func (mbd DetailsArray) ReduceSimpleMedianByName() (reduceMbd DetailsArray)
ReduceSimpleMedianByName reduces a DetailsArray by merging all Details with the same benchmark name into a single one. The results of each Details correspond to the median of the merged elements.
func (DetailsArray) SortByDate ¶
func (mbd DetailsArray) SortByDate()
SortByDate will sort the given DetailsArray by ascending date
type Result ¶
type Result struct { Ops float64 NSPerOp float64 MBPerSec float64 BytesPerOp float64 AllocsPerOp float64 }
Result contains all the metrics measured by a microbenchmark.