Skip to content

Commit cc6ea8e

Browse files
committed
Add pprof capabilities to the binary.
1 parent 135e1a6 commit cc6ea8e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

cmd/go-graphkb/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import (
66
"strings"
77
"time"
88

9+
_ "net/http/pprof"
10+
911
"github.com/clems4ever/go-graphkb/internal/database"
1012
"github.com/clems4ever/go-graphkb/internal/knowledge"
1113
"github.com/clems4ever/go-graphkb/internal/server"

internal/server/server.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ func StartServer(listenInterface string,
204204
flushDatabaseHandler = AuthMiddleware(flushDatabaseHandler)
205205
}
206206

207+
r.PathPrefix("/debug/pprof/").Handler(http.DefaultServeMux)
207208
r.HandleFunc("/api/sources", listSourcesHandler).Methods("GET")
208209
r.HandleFunc("/api/schema", getSourceGraphHandler).Methods("GET")
209210
r.HandleFunc("/api/database", getDatabaseDetailsHandler).Methods("GET")

0 commit comments

Comments
 (0)