Created
March 25, 2016 14:29
-
-
Save markstgodard/c84bf9219d12ecb87fc5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/main.go b/main.go | |
index 2a7795b..cff7880 100644 | |
--- a/main.go | |
+++ b/main.go | |
@@ -3,6 +3,7 @@ package main | |
import ( | |
"crypto/tls" | |
"errors" | |
+ "log" | |
"github.com/apcera/nats" | |
cf_debug_server "github.com/cloudfoundry-incubator/cf-debug-server" | |
@@ -31,6 +32,9 @@ import ( | |
"syscall" | |
"time" | |
+ "net/http" | |
+ _ "net/http/pprof" | |
+ | |
"github.com/cloudfoundry/gorouter/metrics" | |
"github.com/tedsuo/ifrit" | |
"github.com/tedsuo/ifrit/grouper" | |
@@ -47,6 +51,10 @@ const ( | |
) | |
func main() { | |
+ go func() { | |
+ log.Println(http.ListenAndServe("localhost:6060", nil)) | |
+ }() | |
+ | |
flag.StringVar(&configFile, "c", "", "Configuration File") | |
cf_lager.AddFlags(flag.CommandLine) | |
flag.Parse() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Attaching:
go tool pprof http://localhost:6060/debug/pprof/profile
(before the waiting 30s)
dot -Tpng mydot.dot < mydot.png