mirror of
https://github.com/minio/minio.git
synced 2025-11-11 06:20:14 -05:00
server: Enable server profiling as needed. (#1565)
This commit is contained in:
committed by
Anand Babu (AB) Periasamy
parent
f733120d3d
commit
b66c3bf35e
44
vendor/github.com/pkg/profile/README.md
generated
vendored
Normal file
44
vendor/github.com/pkg/profile/README.md
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
profile
|
||||
=======
|
||||
|
||||
Simple profiling support package for Go
|
||||
|
||||
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
|
||||
|
||||
```go
|
||||
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.
|
||||
|
||||
```go
|
||||
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](http://godoc.org/github.com/pkg/profile).
|
||||
Reference in New Issue
Block a user