Flakiness Dashboard v2
Type safety, improved performance
12 July 2016
Nishanth Shanmugham
Nishanth Shanmugham
func wrap(h middleware.Handler) httprouter.Handle { h = auth.Authenticate(h) h = templates.WithTemplates(h, tmpl) h = middleware.WithContextValue(h, configContextKey(0), &cfg) return base(h) } r.GET("/hello", wrap(helloPage))
Essentially
base(middleware.WithContextValue(templates.WithTemplates(auth.Authenticate(helloPage...
Reversed order.
5func helloPage(c context.Context w http.ResponseWriter, r *http.Request, p httprouter.Params)
Can we do better?
7Create middleware chain
mw := router.NewMiddlewareChain( base, middleware.WithContextValue(configContextKey(0), &cfg), templates.WithTemplates(tmpl), auth.Authenticate, )
Register middleware and handler
r.GET("/hello", mw, helloPage)
New
mw := router.NewMiddlewareChain( base, middleware.WithContextValue(configContextKey(0), &cfg), templates.WithTemplates(tmpl), auth.Authenticate ) r.GET("/hello", mw, helloPage)
Old
func wrap(h middleware.Handler) httprouter.Handle { h = auth.Authenticate(h) h = templates.WithTemplates(h, tmpl) h = middleware.WithContextValue(h, configContextKey(0), &cfg) return base(h) } r.GET("/hello", wrap(helloPage))
func helloPage(c *router.Context) type Context struct { Context context.Context Writer http.ResponseWriter Request *http.Request Params httprouter.Params }
New
func helloPage(c *router.Context)
Old
func helloPage(c context.Context w http.ResponseWriter, r *http.Request, p httprouter.Params)
github.com/luci/luci-go/server/router
13
test-results.appspot.com
test-results.appspot.com/dashboards/flakiness_dashboard.html
Get results: /testilfe
Bots upload results: /testfile/upload
/updatebuilders
chrome-build-extract.appspot.com/get_master/chromium.fyi
chrome-build-extract.appspot.com/get_builds?builder=CrWinAsan&master=chromium.fyi&num_builds=1
/updatebuilders
2.5x faster, can compute builders information more frequently if needed
19Requests that failed on Python app no longer fail in Go app
/testfile?master=tryserver.chromium.win&builder=win_chromium_rel_ng&name=results.json&testlistjson=1&testtype=unit_tests%20(with%20patch)
New
<!DOCTYPE html> <title>Test Results</title> <link rel="stylesheet" href="/stylesheets/testfile.css" /> <script>...</script> <h1>Test Results ...
Old
<!DOCTYPE html> <html> <head> <title>Test Results</title> <link type="text/css" rel="stylesheet" href="/stylesheets/testfile.css" /> <script>...</script> </head> <body> <h1>Test Results ...
/testfile | Done |
/testfile/upload | In progress |
/builders | In review |
/updatebuilders | In review |
/builderstate | In review |
/updatebuilderstate | In review |
/internal/monitoring/upload (eventmon) | In progress |
go.test-results.appspot.com/testfile
25infra/go/src/infra/appengine/test-results
26Nishanth Shanmugham