diff --git a/syz-cluster/dashboard/handler.go b/syz-cluster/dashboard/handler.go index 2212bd959f38..42fad9bbe33d 100644 --- a/syz-cluster/dashboard/handler.go +++ b/syz-cluster/dashboard/handler.go @@ -218,6 +218,7 @@ func (h *dashboardHandler) statsPage(w http.ResponseWriter, r *http.Request) err type StatsPageData struct { Processed []*db.CountPerWeek Findings []*db.CountPerWeek + Reports []*db.CountPerWeek Delay []*db.DelayPerWeek Distribution []*db.StatusPerWeek } @@ -231,6 +232,10 @@ func (h *dashboardHandler) statsPage(w http.ResponseWriter, r *http.Request) err if err != nil { return fmt.Errorf("failed to query findings data: %w", err) } + data.Reports, err = h.statsRepo.ReportsPerWeek(r.Context()) + if err != nil { + return fmt.Errorf("failed to query reports data: %w", err) + } data.Delay, err = h.statsRepo.DelayPerWeek(r.Context()) if err != nil { return fmt.Errorf("failed to query delay data: %w", err) @@ -388,6 +393,9 @@ func errToStatus(f func(http.ResponseWriter, *http.Request) error) http.HandlerF } else if errors.Is(err, errBadRequest) { http.Error(w, err.Error(), http.StatusBadRequest) } else if err != nil { + // TODO: if the error happened in the template, likely we've already printed + // something to w. Unless we're in streamBlob(), it makes sense to first collect + // the output in some buffer and only dump it after the exit from the handler. http.Error(w, err.Error(), http.StatusInternalServerError) } } diff --git a/syz-cluster/dashboard/handler_test.go b/syz-cluster/dashboard/handler_test.go index a1200582edfa..8bdb5c318226 100644 --- a/syz-cluster/dashboard/handler_test.go +++ b/syz-cluster/dashboard/handler_test.go @@ -26,7 +26,11 @@ func TestURLs(t *testing.T) { handler, baseURL := testServer(t, env) urlGen := api.NewURLGenerator(baseURL) - urls := []string{urlGen.Series(ids.SeriesID)} + urls := []string{ + baseURL, + baseURL + "/stats", + urlGen.Series(ids.SeriesID), + } for _, buildID := range []string{ids.BaseBuildID, ids.PatchedBuildID} { urls = append(urls, urlGen.BuildConfig(buildID)) urls = append(urls, urlGen.BuildLog(buildID)) diff --git a/syz-cluster/dashboard/templates/graphs.html b/syz-cluster/dashboard/templates/graphs.html index e972b81caa84..c4da3289f28d 100644 --- a/syz-cluster/dashboard/templates/graphs.html +++ b/syz-cluster/dashboard/templates/graphs.html @@ -18,6 +18,15 @@
How many reports with findings have been published.
+ +Click and drag to zoom into a time range. Right-click to reset.
+How many hours have passed since the moment the series was published and the moment we started fuzzing it.
@@ -67,9 +76,16 @@