Skip to content

Commit

Permalink
Remove lightweight init
Browse files Browse the repository at this point in the history
  • Loading branch information
jtibshirani committed Sep 9, 2024
1 parent 080d0b9 commit be99dcf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion cmd/zoekt-git-index/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func run() int {
opts.LanguageMap[m[0]] = ctags.StringToParser(m[1])
}

profiler.InitLightweight("zoekt-git-index")
profiler.Init("zoekt-git-index")
exitStatus := 0
for dir, name := range gitRepos {
opts.RepositoryDescription.Name = name
Expand Down
14 changes: 0 additions & 14 deletions internal/profiler/profiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,3 @@ func Init(svcName string) {
}
}
}

// InitLightweight starts the supported profilers IFF the environment variable is set.
// Compared to Init, it disables mutex profiling and forced GC to reduce its overhead.
func InitLightweight(svcName string) {
if os.Getenv("GOOGLE_CLOUD_PROFILER_ENABLED") != "" {
err := profiler.Start(profiler.Config{
Service: svcName,
ServiceVersion: zoekt.Version,
})
if err != nil {
log.Printf("could not initialize profiler: %s", err.Error())
}
}
}

0 comments on commit be99dcf

Please sign in to comment.