diff --git a/README.md b/README.md new file mode 100644 index 0000000..084a7fb --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# ezprof + +Host pprof at localhost:8888 in one line. In any Go file, put: + +```go +import _ "git.tebibyte.media/sashakoshka/ezprof/hook" +``` + +And you will be able to connect to your program with the pprof tool. diff --git a/hook/ezprof.go b/hook/ezprof.go new file mode 100644 index 0000000..401d402 --- /dev/null +++ b/hook/ezprof.go @@ -0,0 +1,10 @@ +package ezprof + +import "net/http" +import _ "net/http/pprof" + +func init () { + go func () { + http.ListenAndServe("localhost:8888", nil) + } () +}