Enable http pprof connections when pprof-address is set.
Add flag to specify the address where those connections listen. Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
@@ -55,6 +55,10 @@ var daemonFlags = []cli.Flag{
|
||||
Value: &cli.StringSlice{},
|
||||
Usage: "specify additional runtime args",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "pprof-address",
|
||||
Usage: "http address to listen for pprof events",
|
||||
},
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/cloudfoundry/gosigar"
|
||||
"github.com/codegangsta/cli"
|
||||
"github.com/cyberdelia/go-metrics-graphite"
|
||||
"github.com/docker/containerd/api/http/pprof"
|
||||
"github.com/docker/containerd/osutils"
|
||||
"github.com/docker/containerd/supervisor"
|
||||
"github.com/rcrowley/go-metrics"
|
||||
@@ -37,6 +38,10 @@ func setAppBefore(app *cli.App) {
|
||||
if err := debugMetrics(context.GlobalDuration("metrics-interval"), context.GlobalString("graphite-address")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
}
|
||||
if p := context.GlobalString("pprof-address"); len(p) > 0 {
|
||||
pprof.Enable(p)
|
||||
}
|
||||
if err := checkLimits(); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user