ctr: move pprof to commands package

Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
This commit is contained in:
Jess Valarezo 2017-10-29 21:03:21 -04:00
parent a827a17f1d
commit f654b7b71e
4 changed files with 10 additions and 8 deletions

View File

@ -1,4 +1,4 @@
package main
package pprof
import (
"fmt"
@ -17,7 +17,8 @@ type pprofDialer struct {
addr string
}
var pprofCommand = cli.Command{
// Command is the cli command for providing golang pprof outputs for containerd
var Command = cli.Command{
Name: "pprof",
Usage: "provide golang pprof outputs for containerd",
Flags: []cli.Flag{
@ -28,12 +29,12 @@ var pprofCommand = cli.Command{
},
},
Subcommands: []cli.Command{
pprofBlockCommand,
pprofGoroutinesCommand,
pprofHeapCommand,
pprofProfileCommand,
pprofTraceCommand,
pprofBlockCommand,
pprofThreadcreateCommand,
pprofTraceCommand,
},
}
@ -91,7 +92,7 @@ var pprofTraceCommand = cli.Command{
Flags: []cli.Flag{
cli.DurationFlag{
Name: "seconds,s",
Usage: "Trace time (seconds)",
Usage: "trace time (seconds)",
Value: time.Duration(5 * time.Second),
},
},

View File

@ -1,6 +1,6 @@
// +build !windows
package main
package pprof
import "net"

View File

@ -1,4 +1,4 @@
package main
package pprof
import (
"net"

View File

@ -12,6 +12,7 @@ import (
"github.com/containerd/containerd/cmd/ctr/commands/images"
namespacesCmd "github.com/containerd/containerd/cmd/ctr/commands/namespaces"
"github.com/containerd/containerd/cmd/ctr/commands/plugins"
"github.com/containerd/containerd/cmd/ctr/commands/pprof"
"github.com/containerd/containerd/cmd/ctr/commands/run"
"github.com/containerd/containerd/cmd/ctr/commands/snapshot"
"github.com/containerd/containerd/cmd/ctr/commands/tasks"
@ -81,7 +82,7 @@ containerd CLI
events.Command,
images.Command,
namespacesCmd.Command,
pprofCommand,
pprof.Command,
run.Command,
snapshot.Command,
tasks.Command,