Add profiling endpoints

This commit is contained in:
erroneousboat 2017-12-02 17:35:27 +01:00
parent a585963c43
commit d2ea2ea09c

View File

@ -1,6 +1,9 @@
package context
import (
"net/http"
_ "net/http/pprof"
"github.com/erroneousboat/termui"
termbox "github.com/nsf/termbox-go"
@ -28,6 +31,12 @@ type AppContext struct {
// CreateAppContext creates an application context which can be passed
// and referenced througout the application
func CreateAppContext(flgConfig string, flgDebug bool) (*AppContext, error) {
if flgDebug {
go func() {
http.ListenAndServe(":6060", nil)
}()
}
// Load config
config, err := config.NewConfig(flgConfig)
if err != nil {