diff --git a/cmd/zoekt-git-index/main.go b/cmd/zoekt-git-index/main.go index c1aa5d1ad..298504f9d 100644 --- a/cmd/zoekt-git-index/main.go +++ b/cmd/zoekt-git-index/main.go @@ -22,6 +22,8 @@ import ( "runtime/pprof" "strings" + "github.com/sourcegraph/zoekt" + "github.com/sourcegraph/zoekt/internal/profiler" "go.uber.org/automaxprocs/maxprocs" "github.com/sourcegraph/zoekt/cmd" @@ -70,6 +72,7 @@ func run() int { } *repoCacheDir = dir } + opts := cmd.OptionsFromFlags() opts.IsDelta = *isDelta opts.DocumentRanksPath = *offlineRanking @@ -107,6 +110,7 @@ func run() int { opts.LanguageMap[m[0]] = ctags.StringToParser(m[1]) } + profiler.Init("zoekt-git-index", zoekt.Version) exitStatus := 0 for dir, name := range gitRepos { opts.RepositoryDescription.Name = name diff --git a/cmd/zoekt-sourcegraph-indexserver/main.go b/cmd/zoekt-sourcegraph-indexserver/main.go index 671e3de91..e89073b44 100644 --- a/cmd/zoekt-sourcegraph-indexserver/main.go +++ b/cmd/zoekt-sourcegraph-indexserver/main.go @@ -1277,7 +1277,7 @@ func startServer(conf rootConfig) error { return err } - profiler.Init("zoekt-sourcegraph-indexserver", zoekt.Version, conf.blockProfileRate) + profiler.Init("zoekt-sourcegraph-indexserver", zoekt.Version) setCompoundShardCounter(s.IndexDir) if conf.listen != "" { diff --git a/cmd/zoekt-webserver/main.go b/cmd/zoekt-webserver/main.go index 5503dd3c8..d66ac33df 100644 --- a/cmd/zoekt-webserver/main.go +++ b/cmd/zoekt-webserver/main.go @@ -177,7 +177,7 @@ func main() { liblog := sglog.Init(resource) defer liblog.Sync() tracer.Init(resource) - profiler.Init("zoekt-webserver", zoekt.Version, -1) + profiler.Init("zoekt-webserver", zoekt.Version) if *logDir != "" { if fi, err := os.Lstat(*logDir); err != nil || !fi.IsDir() { diff --git a/internal/profiler/profiler.go b/internal/profiler/profiler.go index 194fc9b4b..05e5e7c9e 100644 --- a/internal/profiler/profiler.go +++ b/internal/profiler/profiler.go @@ -8,7 +8,7 @@ import ( ) // Init starts the supported profilers IFF the environment variable is set. -func Init(svcName, version string, blockProfileRate int) { +func Init(svcName, version string) { if os.Getenv("GOOGLE_CLOUD_PROFILER_ENABLED") != "" { err := profiler.Start(profiler.Config{ Service: svcName,