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

View File

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

View File

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

View File

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