restic/vendor/github.com/pkg/profile
Alexander Neumann bff635bc5f Update dependencies, enable pruning for vendor/
So, `dep` got an nice new feature to remove tests and non-go files from
`vendor/`, and this brings the size of the vendor directory from ~300MiB
down to ~20MiB. We don that now.
2018-08-01 21:32:15 +02:00
..
.travis.yml Vendor dependencies with dep 2017-07-23 14:25:38 +02:00
AUTHORS Vendor dependencies with dep 2017-07-23 14:25:38 +02:00
LICENSE Vendor dependencies with dep 2017-07-23 14:25:38 +02:00
README.md Vendor dependencies with dep 2017-07-23 14:25:38 +02:00
mutex.go Vendor dependencies with dep 2017-07-23 14:25:38 +02:00
mutex17.go Vendor dependencies with dep 2017-07-23 14:25:38 +02:00
profile.go Vendor dependencies with dep 2017-07-23 14:25:38 +02:00
trace.go Vendor dependencies with dep 2017-07-23 14:25:38 +02:00
trace16.go Vendor dependencies with dep 2017-07-23 14:25:38 +02:00

README.md

profile

Simple profiling support package for Go

Build Status GoDoc

installation

go get github.com/pkg/profile

usage

Enabling profiling in your application is as simple as one line at the top of your main function

import "github.com/pkg/profile"

func main() {
    defer profile.Start().Stop()
    ...
}

options

What to profile is controlled by config value passed to profile.Start. By default CPU profiling is enabled.

import "github.com/pkg/profile"

func main() {
    // p.Stop() must be called before the program exits to
    // ensure profiling information is written to disk.
    p := profile.Start(profile.MemProfile, profile.ProfilePath("."), profile.NoShutdownHook)
    ...
}

Several convenience package level values are provided for cpu, memory, and block (contention) profiling.

For more complex options, consult the documentation.

contributing

We welcome pull requests, bug fixes and issue reports.

Before proposing a change, please discuss it first by raising an issue.