[CHANGED] Profiler: Start profile_port earlier

Enables use of pprof to investigate server startup.

Co-authored-by: Ivan Kozlovic <ivan@synadia.com>
Signed-off-by: Ben Werthmann <ben@synadia.com>
This commit is contained in:
Ben Werthmann
2021-12-01 16:03:23 -05:00
parent adf974d681
commit d7eec1edd4

View File

@@ -1541,6 +1541,11 @@ func (s *Server) Start() {
s.grRunning = true
s.grMu.Unlock()
// Pprof http endpoint for the profiler.
if opts.ProfPort != 0 {
s.StartProfiler()
}
if opts.ConfigFile != _EMPTY_ {
s.Noticef("Using configuration file: %s", opts.ConfigFile)
}
@@ -1740,11 +1745,6 @@ func (s *Server) Start() {
})
}
// Pprof http endpoint for the profiler.
if opts.ProfPort != 0 {
s.StartProfiler()
}
if opts.PortsFileDir != _EMPTY_ {
s.logPorts()
}