plugin/pprof - add option to enable block profiling (#2729)

* - add an option for block profiling to plugin pprof

* - move option block into nested block
This commit is contained in:
Francois Tur
2019-03-29 02:37:17 -04:00
committed by Miek Gieben
parent f6eb2a4c14
commit c144da2524
4 changed files with 53 additions and 11 deletions

View File

@@ -17,10 +17,16 @@ This plugin can only be used once per Server Block.
## Syntax
~~~
pprof [ADDRESS]
pprof [ADDRESS] {
block [RATE]
}
~~~
If not specified, ADDRESS defaults to localhost:6053.
- If not specified, **ADDRESS** defaults to localhost:6053.
- `block` option allow to enable the `block` profiling. see [Diagnostics, chapter profiling](https://golang.org/doc/diagnostics.html).
if you need to use `block` profile, set a positive value to **RATE**. See [runtime.SetBlockProfileRate](https://golang.org/pkg/runtime/#SetBlockProfileRate).
if not specified, **RATE** default's to 1. if `block` option is not specified the `block` profiling is disabled.
## Examples
@@ -42,11 +48,13 @@ Listen on an alternate address:
}
~~~
Listen on an all addresses on port 6060:
Listen on an all addresses on port 6060: and enable block profiling
~~~ txt
. {
pprof :6060
pprof :6060 {
block
}
}
~~~