diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2021-11-25 17:55:58 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2021-12-06 14:29:36 +0100 |
| commit | 9fca97cadd2e63056f40e69d80ca1e798b2a18e8 (patch) | |
| tree | 6e6ae13406cd08aa46785cfdea86c6b00ae5465e /tools/syz-testbed/html.go | |
| parent | 1ba1043eb4dc79008b7138f2fc04e136e2f796a3 (diff) | |
tools/syz-testbed: introduce a special type for table
This simplifies table generation and will let us more easily implement
relative difference and p-value calculation and printing.
Diffstat (limited to 'tools/syz-testbed/html.go')
| -rw-r--r-- | tools/syz-testbed/html.go | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tools/syz-testbed/html.go b/tools/syz-testbed/html.go index fa3786cd4..196c12a3c 100644 --- a/tools/syz-testbed/html.go +++ b/tools/syz-testbed/html.go @@ -12,7 +12,6 @@ import ( "net" "net/http" "os" - "sort" "time" "github.com/google/syzkaller/pkg/html" @@ -103,12 +102,12 @@ func (ctx *TestbedContext) httpGraph(w http.ResponseWriter, r *http.Request) { type uiStatView struct { Name string - Table [][]string + Table *Table } type uiMainPage struct { Name string - Summary [][]string + Summary *Table Views []uiStatView } @@ -125,12 +124,6 @@ func (ctx *TestbedContext) httpMain(w http.ResponseWriter, r *http.Request) { log.Printf("stat table generation failed: %s", err) continue } - sort.SliceStable(table, func(i, j int) bool { - if len(table[i]) == 0 || len(table[j]) == 0 { - return i < j - } - return table[i][0] < table[j][0] - }) uiViews = append(uiViews, uiStatView{ Name: view.Name, Table: table, @@ -167,12 +160,19 @@ var mainTemplate = html.CreatePage(` {{define "Table"}} {{if .}} <table class="list_table"> - {{range $c := .}} <tr> - {{range $v := $c}} - <td>{{$v}}</td> + <th>{{.TopLeftHeader}}</th> + {{range $c := .ColumnHeaders}} + <th>{{$c}}</th> {{end}} </tr> + {{range $r := .SortedRows}} + <tr> + <td>{{$r}}</td> + {{range $c := $.ColumnHeaders}} + <td>{{$.Get $r $c}}</td> + {{end}} + </tr> {{end}} </table> {{end}} |
