Skip to content

Commit

Permalink
netprofile.
Browse files Browse the repository at this point in the history
  • Loading branch information
corywalker committed Sep 7, 2017
1 parent 92c72c6 commit cb27473
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions expreduce.go
Expand Up @@ -8,10 +8,13 @@ import (
"log"
"os"
"runtime/pprof"
"net/http"
_ "net/http/pprof"
)

var debug = flag.Bool("debug", false, "Debug mode. No initial definitions.")
var cpuprofile = flag.String("cpuprofile", "", "write cpu profile to file")
var netprofile = flag.Bool("netprofile", false, "Enable live profiling at http://localhost:8080/debug/pprof/")

func main() {
flag.Parse()
Expand All @@ -23,6 +26,9 @@ func main() {
pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile()
}
if *netprofile {
go http.ListenAndServe(":8080", nil)
}

rl, err := readline.NewEx(&readline.Config{
HistoryFile: "/tmp/readline.tmp",
Expand Down

0 comments on commit cb27473

Please sign in to comment.