Package Usage: go: github.com/e-dard/netbug
Package netbug provides an http.Handler for executing the various
profilers and debug tools in the Go standard library.
netbug provides some advantages over the /net/http/pprof and
/runtime/pprof packages:
The simplest integration of netbug looks like:
You can then access the index page via GET /myroute/
The netbug.RegisterAuthHandler function lets you register the handler on
your http.ServeMux and add some simple authentication, in the
form of a URL parameter:
You can then access the index page via:
The package also provides access to the handlers directly, for when
you want to, say, wrap them in your own logic. Just be sure that
when you use the handlers that netbug provides, you take care to use
`http.StripPrefix` to strip the route you registered the handler on.
This is because the handlers' logic expect them to be registered on
"/".
As you would expect, netbug works the same way with the go profiler
tool as /net/http/pprof does. To run a 30 second CPU profile on your
service for example:
1 version
Latest release: over 9 years ago
6 dependent packages
View more package details: https://packages.ecosystem.code.gouv.fr/registries/proxy.golang.org/packages/github.com/e-dard/netbug