go(stats): add explanatory comments [skip ci]

This commit is contained in:
surtur 2022-06-25 21:47:53 +02:00
parent d2c4f2b1db
commit 3940036304
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

@ -11,6 +11,7 @@ import (
"gonum.org/v1/gonum/stat"
)
// statsRow represents the header in the table.
type statsHdr struct {
Algo string
BenchFuncName string
@ -19,6 +20,7 @@ type statsHdr struct {
Iterations int
}
// statsRow represents a single row in the table.
type statsRow struct {
Min float64
Max float64
@ -76,6 +78,8 @@ func statsSingleFunc(singleFuncStats []Stats) {
}
}
// makeTableHdr fills the table header with passed information.
// TODO(me): add checks to assert only valid inputs are passed in.
func makeTableHdr(
algo, benchFuncName string,
dimens, generations, iterations int,
@ -91,6 +95,7 @@ func makeTableHdr(
return *hdr
}
// newStatsHdr returns a pointer to a newly created statsHdr instance.
func newStatsHdr() *statsHdr {
return &statsHdr{}
}