"flag"
"io"
"log"
+ "net/http"
+ _ "net/http/pprof"
"os"
"git.arvados.org/arvados.git/sdk/go/arvados"
// not be called more than once, or when ready is already
// closed.
ready chan struct{}
- // It is safe to call Unmount ounly after ready has been
+ // It is safe to call Unmount only after ready has been
// closed.
Unmount func() (ok bool)
}
ro := flags.Bool("ro", false, "read-only")
experimental := flags.Bool("experimental", false, "acknowledge this is an experimental command, and should not be used in production (required)")
blockCache := flags.Int("block-cache", 4, "read cache size (number of 64MiB blocks)")
+ pprof := flags.String("pprof", "", "serve Go profile data at `[addr]:port`")
err := flags.Parse(args)
if err != nil {
logger.Print(err)
logger.Printf("error: experimental command %q used without --experimental flag", prog)
return 2
}
+ if *pprof != "" {
+ go func() {
+ log.Println(http.ListenAndServe(*pprof, nil))
+ }()
+ }
client := arvados.NewClientFromEnv()
ac, err := arvadosclient.New(client)