pprof

package
v0.0.0-...-db4e6ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2018 License: MIT Imports: 0 Imported by: 0

README

Revel pprof module

How to use:
  1. Open your app.conf file and add the following line:
    module.pprof=github.com/revel/modules/pprof
    This will enable the pprof module.

  2. Next, open your routes file and add:
    module:pprof Note: Do not change these routes. The pprof command-line tool by default assumes these routes.

Congrats! You can now profile your application. To use the web interface, visit http://<host>:<port>/debug/pprof. You can also use the go tool pprof command to profile your application and get a little deeper. Use the command by running go tool pprof <binary> http://<host>:<port>. For example, if you modified the booking sample, you would run: go tool pprof $GOPATH/bin/booking http://localhost:9000 (assuming you used the default revel run arguments.

The command-line tool will take a 30-second CPU profile, and save the results to a temporary file in your $HOME/pprof directory. You can reference this file at a later time by using the same command as above, but by specifying the filename instead of the server address.

In order to fully utilize the command-line tool, you may need the graphviz utilities. If you're on OS X, you can install these easily using Homebrew: brew install graphviz.

To read more about profiling Go programs, here is some reading material: The Go Blog : net/pprof package documentation

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
app

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL