mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-22 11:47:42 +00:00
add pprof endpoints
This commit is contained in:
parent
13af0d1b4a
commit
01a4ae9559
1 changed files with 6 additions and 0 deletions
|
@ -2,6 +2,8 @@ package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"net/http"
|
||||||
|
_ "net/http/pprof"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"runtime/pprof"
|
"runtime/pprof"
|
||||||
|
@ -67,6 +69,10 @@ func Execute(ctx context.Context) int {
|
||||||
rootCmd.AddCommand(SchedulerCmd(ctx))
|
rootCmd.AddCommand(SchedulerCmd(ctx))
|
||||||
rootCmd.AddCommand(WorkerCmd(ctx))
|
rootCmd.AddCommand(WorkerCmd(ctx))
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
_ = http.ListenAndServe("localhost:6060", nil)
|
||||||
|
}()
|
||||||
|
|
||||||
if err := rootCmd.Execute(); err != nil {
|
if err := rootCmd.Execute(); err != nil {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue