Documentation ¶
Overview ¶
Package debug wraps the gops agent for use as a cmdutil-compatible Server.
The debug server will be started on DEBUG_PORT (default 9999). Get a stack trace, profile memory, etc. by running the gops command line connected to locahost:9999 like:
$ gops stack localhost:9999 goroutine 50 [running]: runtime/pprof.writeGoroutineStacks(0x4a18a20, 0xc000010138, 0x0, 0x0) /usr/local/Cellar/go/1.13.5/libexec/src/runtime/pprof/pprof.go:679 +0x9d runtime/pprof.writeGoroutine(0x4a18a20, 0xc000010138, 0x2, 0x0, 0x0) ...
Learn more about gops at https://github.com/google/gops.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Port int `env:"DEBUG_PORT,default=9999"`
}
Config describes the configurable parameters for debugging.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wraps a gops server for easy use with oklog/group.
func New ¶
func New(l logrus.FieldLogger, port int) *Server
New inializes a debug server listening on the provided port.
Connect to the debug server with gops:
gops stack localhost:PORT
Click to show internal directories.
Click to hide internal directories.