aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/app/coverage.go
diff options
context:
space:
mode:
Diffstat (limited to 'dashboard/app/coverage.go')
-rw-r--r--dashboard/app/coverage.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/dashboard/app/coverage.go b/dashboard/app/coverage.go
index 4611a7977..67a4494e0 100644
--- a/dashboard/app/coverage.go
+++ b/dashboard/app/coverage.go
@@ -21,6 +21,7 @@ import (
"github.com/google/syzkaller/pkg/html/urlutil"
"github.com/google/syzkaller/pkg/validator"
"google.golang.org/appengine/v2"
+ "google.golang.org/appengine/v2/log"
)
var coverageDBClient spannerclient.SpannerClient
@@ -393,3 +394,23 @@ func handleCoverageGraph(c context.Context, w http.ResponseWriter, r *http.Reque
}
return serveTemplate(w, "graph_histogram.html", data)
}
+
+func handleUpdateCoverDBSubsystems(w http.ResponseWriter, r *http.Request) {
+ ctx := r.Context()
+ for ns, nsConfig := range getConfig(ctx).Namespaces {
+ service := nsConfig.Subsystems.Service
+ if service == nil {
+ continue
+ }
+ sss := service.List()
+ updatedRecords, err := coveragedb.RegenerateSubsystems(ctx, ns, sss, coverageDBClient)
+ if err != nil {
+ httpErr := fmt.Errorf("ns %s: %w", ns, err)
+ log.Errorf(ctx, "%s", httpErr.Error())
+ http.Error(w, httpErr.Error(), http.StatusInternalServerError)
+ return
+ }
+ log.Infof(ctx, "%s: %v records updated\n", ns, updatedRecords)
+ fmt.Fprintf(w, "%s: %v records updated\n", ns, updatedRecords)
+ }
+}