diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2021-11-26 16:15:37 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2021-12-06 14:29:36 +0100 |
| commit | 9bc82119f890ecaa556935301dc721f90100d2dd (patch) | |
| tree | 6812ecfd10fabb319f3c502cd69b9b7f443d9025 /pkg/html/html.go | |
| parent | 8a9bfbcda821c7c38dba195d7ba4a5f34463b49b (diff) | |
tools/syz-testbed: show diffs and p-values
Enable the user to specify the pivot column for the stats table. If
such a column is set, calculate and print the relative difference
between checkouts and p-values for the estimation of statistical
significance of the experimental data.
For the p-value calculation use the existing implementation from the
go-benchstat tool.
Diffstat (limited to 'pkg/html/html.go')
| -rw-r--r-- | pkg/html/html.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/html/html.go b/pkg/html/html.go index 6d24ba7e7..0b6fdaa75 100644 --- a/pkg/html/html.go +++ b/pkg/html/html.go @@ -8,6 +8,7 @@ package html import ( "fmt" "html/template" + "reflect" "strings" texttemplate "text/template" "time" @@ -46,6 +47,7 @@ var Funcs = template.FuncMap{ "formatCommitTableTitle": formatCommitTableTitle, "formatList": formatStringList, "selectBisect": selectBisect, + "dereference": dereferencePointer, } func selectBisect(rep *dashapi.BugReport) *dashapi.BisectResult { @@ -180,3 +182,14 @@ func formatCommitTableTitle(v string) string { func formatStringList(list []string) string { return strings.Join(list, ", ") } + +func dereferencePointer(v interface{}) interface{} { + reflectValue := reflect.ValueOf(v) + if !reflectValue.IsNil() && reflectValue.Kind() == reflect.Ptr { + elem := reflectValue.Elem() + if elem.CanInterface() { + return elem.Interface() + } + } + return v +} |
