Add pprof
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
04edeccbf4
commit
710286d6e7
@ -7,6 +7,8 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"math"
|
"math"
|
||||||
|
"net/http"
|
||||||
|
_ "net/http/pprof"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"runtime/pprof"
|
"runtime/pprof"
|
||||||
@ -249,6 +251,10 @@ var importAnalyzeCmd = &cli.Command{
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
http.ListenAndServe("localhost:6060", nil)
|
||||||
|
}()
|
||||||
|
|
||||||
fi, err := os.Open(cctx.Args().First())
|
fi, err := os.Open(cctx.Args().First())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -282,6 +288,7 @@ var importAnalyzeCmd = &cli.Command{
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
totalTime += tse.Duration
|
totalTime += tse.Duration
|
||||||
for _, inv := range tse.Trace {
|
for _, inv := range tse.Trace {
|
||||||
if inv.Duration > leastExpensiveInvoc {
|
if inv.Duration > leastExpensiveInvoc {
|
||||||
|
Loading…
Reference in New Issue
Block a user