|
|
@ -31,15 +31,12 @@ import ( |
|
|
|
"github.com/ethereum/go-ethereum/log" |
|
|
|
"github.com/ethereum/go-ethereum/log" |
|
|
|
"github.com/ethereum/go-ethereum/metrics" |
|
|
|
"github.com/ethereum/go-ethereum/metrics" |
|
|
|
"github.com/ethereum/go-ethereum/metrics/exp" |
|
|
|
"github.com/ethereum/go-ethereum/metrics/exp" |
|
|
|
"github.com/fjl/memsize/memsizeui" |
|
|
|
|
|
|
|
"github.com/mattn/go-colorable" |
|
|
|
"github.com/mattn/go-colorable" |
|
|
|
"github.com/mattn/go-isatty" |
|
|
|
"github.com/mattn/go-isatty" |
|
|
|
"github.com/urfave/cli/v2" |
|
|
|
"github.com/urfave/cli/v2" |
|
|
|
"gopkg.in/natefinch/lumberjack.v2" |
|
|
|
"gopkg.in/natefinch/lumberjack.v2" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
var Memsize memsizeui.Handler |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ( |
|
|
|
var ( |
|
|
|
verbosityFlag = &cli.IntFlag{ |
|
|
|
verbosityFlag = &cli.IntFlag{ |
|
|
|
Name: "verbosity", |
|
|
|
Name: "verbosity", |
|
|
@ -313,7 +310,6 @@ func StartPProf(address string, withMetrics bool) { |
|
|
|
if withMetrics { |
|
|
|
if withMetrics { |
|
|
|
exp.Exp(metrics.DefaultRegistry) |
|
|
|
exp.Exp(metrics.DefaultRegistry) |
|
|
|
} |
|
|
|
} |
|
|
|
http.Handle("/memsize/", http.StripPrefix("/memsize", &Memsize)) |
|
|
|
|
|
|
|
log.Info("Starting pprof server", "addr", fmt.Sprintf("http://%s/debug/pprof", address)) |
|
|
|
log.Info("Starting pprof server", "addr", fmt.Sprintf("http://%s/debug/pprof", address)) |
|
|
|
go func() { |
|
|
|
go func() { |
|
|
|
if err := http.ListenAndServe(address, nil); err != nil { |
|
|
|
if err := http.ListenAndServe(address, nil); err != nil { |
|
|
|