4 Simple profiling support package for Go
6 [![Build Status](https://travis-ci.org/pkg/profile.svg?branch=master)](https://travis-ci.org/pkg/profile) [![GoDoc](http://godoc.org/github.com/pkg/profile?status.svg)](http://godoc.org/github.com/pkg/profile)
12 go get github.com/pkg/profile
17 Enabling profiling in your application is as simple as one line at the top of your main function
20 import "github.com/pkg/profile"
23 defer profile.Start().Stop()
31 What to profile is controlled by config value passed to profile.Start.
32 By default CPU profiling is enabled.
35 import "github.com/pkg/profile"
38 // p.Stop() must be called before the program exits to
39 // ensure profiling information is written to disk.
40 p := profile.Start(profile.MemProfile, profile.ProfilePath("."), profile.NoShutdownHook)
45 Several convenience package level values are provided for cpu, memory, and block (contention) profiling.
47 For more complex options, consult the [documentation](http://godoc.org/github.com/pkg/profile).
52 We welcome pull requests, bug fixes and issue reports.
54 Before proposing a change, please discuss it first by raising an issue.