Documentation ¶
Overview ¶
Package stats Provides the StatBenchmark type that is capable of getting statistics for a benchmark given number of iterations.
Package stats Utilities that help calculating statistical measures.
Index ¶
Constants ¶
const ( // Mean opt Mean StatType = "mean" // Sum opt Sum = "sum" // Mode opt Mode = "mode" // Highest opt Highest = "highest" // Lowest opt Lowest = "lowest" // Range opt Range = "range" // All opt All = "all" // Graph opt Graph = "graph" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BenchmarkStat ¶
type BenchmarkStat struct {
// contains filtered or unexported fields
}
BenchmarkStat represents a statistical Benchmark
func NewBenchmarkStat ¶
func NewBenchmarkStat(benchmark bmark.Benchmark, options ...StatType) BenchmarkStat
NewBenchmarkStat create a new Benchmark with statistics qualities NewBenchmarkStat(benchmark, "mean", "mode") || NewBenchmarkStat(benchmark, stats.Mean, stats.Mode)
func (BenchmarkStat) GetStat ¶
func (benchmark BenchmarkStat) GetStat(what StatType) (string, error)
GetStat return a computed StatType
func (*BenchmarkStat) PrintStats ¶
func (benchmark *BenchmarkStat) PrintStats()
PrintStats prints the selected stats options.
type Counter ¶
type Counter struct { *List // contains filtered or unexported fields }
Counter A type composed from List capable of keeping track of each element in a key value pair.
func (*Counter) Add ¶
Add add to counter, if element exists then increment count. Does this in a separate map and also adds to the main item array.
func (*Counter) AddByArray ¶
AddByArray add to the Counter and List by an array. OPTION() Can remove the abstraction.
Notes ¶
Bugs ¶
Function does not work as expected.