Add profiling endpoints
This commit is contained in:
parent
a585963c43
commit
d2ea2ea09c
@ -1,6 +1,9 @@
|
|||||||
package context
|
package context
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
|
_ "net/http/pprof"
|
||||||
|
|
||||||
"github.com/erroneousboat/termui"
|
"github.com/erroneousboat/termui"
|
||||||
termbox "github.com/nsf/termbox-go"
|
termbox "github.com/nsf/termbox-go"
|
||||||
|
|
||||||
@ -28,6 +31,12 @@ type AppContext struct {
|
|||||||
// CreateAppContext creates an application context which can be passed
|
// CreateAppContext creates an application context which can be passed
|
||||||
// and referenced througout the application
|
// and referenced througout the application
|
||||||
func CreateAppContext(flgConfig string, flgDebug bool) (*AppContext, error) {
|
func CreateAppContext(flgConfig string, flgDebug bool) (*AppContext, error) {
|
||||||
|
if flgDebug {
|
||||||
|
go func() {
|
||||||
|
http.ListenAndServe(":6060", nil)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
// Load config
|
// Load config
|
||||||
config, err := config.NewConfig(flgConfig)
|
config, err := config.NewConfig(flgConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user