tree: ca5f10f8b87be5d607141896a57b50951bdf0fde [path history] [tgz]
  1. api/
  2. testdata/
  3. BUILD.bazel
  4. cookieconsent.html
  5. frontend.go
  6. frontend_test.go
  7. googleanalytics.html
  8. README.md
perf/go/frontend/README.md

This directory contains the frontend service implementation and it's respective controllers.

The frontend service is intended to host api endpoints that are user facing and invoked from the UI.

frontend.go is the entry point to the service and defines what apis are to be hosted. It also creates the necessary objects (store implementations, data/feature providers, etc) that are required by the individual apis and passes them on when creating the api instances.

api directory contains individual apis that have a struct per category. Below are the currently supported apis.

APIDescription
AlertsContains endpoints related to regression alert configurations
FavoritesContains endpoints for the Favorites feature
GraphsContains endpoints that provide data and trigger actions related to plotting individual graphs
PinpointContains endpoints related to pinpoint jobs
QueryContains endpoints that serve the query dialog
RegressionsContains endpoints related to regressions detected by the system
ShortcutsContains endpoints that create and manage shortcuts

Adding a new endpoint

  1. Check if the endpoint you are adding falls into any of the categories described above.
  2. If yes, add your handler function for the endpoint in the respective file and register the http route for that endpoint in the RegisterHandlers function in that file.
  3. If no, create a new file and define a struct for the api. The struct needs to implement the FrontendApi interface, so add the RegisterHandlers implementation and add the routes and their corresponding handlers. Once ready, add your struct implementation to the list in getFrontendApis() in frontend.go.