blob: 707612fb753a68f381fe33e4c46485cd9b44e59f [file] [log] [blame]
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// perf runs an HTTP server for benchmark analysis.
package main
import (
var (
perfdataURL = flag.String("perfdata", "", "perfdata server base `url`")
influxHost = flag.String("influx-host", os.Getenv("INFLUX_HOST"), "URL of the InfluxDB instance")
influxToken = flag.String("influx-token", os.Getenv("INFLUX_TOKEN"), "Authentication token for the InfluxDB instance")
influxProject = flag.String("influx-project", os.Getenv("INFLUX_PROJECT"), "GCP project ID for the InfluxDB instance. If empty, defaults to the project this service is running as. If -influx-token is not set, the token is fetched from Secret Manager in the project.")
authCronEmail = flag.String("auth-cron-email", "", "If set, requests to /cron/syncinflux must be authenticated as the passed service account.")
func main() {
app := &app.App{
StorageClient: &perfdata.Client{BaseURL: *perfdataURL},
InfluxHost: *influxHost,
InfluxToken: *influxToken,
InfluxProject: *influxProject,
AuthCronEmail: *authCronEmail,
mux := http.NewServeMux()
ctx := context.Background()
log.Fatal(https.ListenAndServe(ctx, mux))