1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

cmd/serve: pprof cpu and memory profile dumps to disk (#4560)

This commit is contained in:
Jerry Jacobs
2018-08-07 20:49:18 +02:00
committed by techknowlogick
parent ed3589f429
commit b1bc08e268
4 changed files with 70 additions and 1 deletions

View File

@@ -111,6 +111,7 @@ var (
LandingPageURL LandingPage
UnixSocketPermission uint32
EnablePprof bool
PprofDataPath string
SSH = struct {
Disabled bool `ini:"DISABLE_SSH"`
@@ -775,6 +776,10 @@ func NewContext() {
AppDataPath = sec.Key("APP_DATA_PATH").MustString(path.Join(AppWorkPath, "data"))
EnableGzip = sec.Key("ENABLE_GZIP").MustBool()
EnablePprof = sec.Key("ENABLE_PPROF").MustBool(false)
PprofDataPath = sec.Key("PPROF_DATA_PATH").MustString(path.Join(AppWorkPath, "data/tmp/pprof"))
if !filepath.IsAbs(PprofDataPath) {
PprofDataPath = filepath.Join(AppWorkPath, PprofDataPath)
}
switch sec.Key("LANDING_PAGE").MustString("home") {
case "explore":