File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ import (
1818 "fmt"
1919 "io"
2020 "log"
21+ "net"
22+ "net/http"
23+ "os"
2124 "time"
2225 "unsafe"
2326
@@ -71,6 +74,18 @@ func init() {
7174 log .Printf ("[INFO] Version: v%s\n " , version .FdwVersion .String ())
7275 log .Printf ("[INFO] Log level: %s\n " , level )
7376
77+ if _ , found := os .LookupEnv ("STEAMPIPE_FDW_PPROF" ); found {
78+ log .Printf ("[INFO] PROFILING!!!!" )
79+ go func () {
80+ listener , err := net .Listen ("tcp" , "localhost:0" )
81+ if err != nil {
82+ log .Println (err )
83+ return
84+ }
85+ log .Printf ("[INFO] Check http://localhost:%d/debug/pprof/" , listener .Addr ().(* net.TCPAddr ).Port )
86+ log .Println (http .Serve (listener , nil ))
87+ }()
88+ }
7489}
7590
7691// Given a list of FdwDeparsedSortGroup and a FdwPlanState,
You can’t perform that action at this time.
0 commit comments