-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpprof.bat
58 lines (48 loc) · 996 Bytes
/
pprof.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@echo off
if "%1"=="/?" (
goto :display_help
)
if "%1"=="/h" (
goto :display_help
)
if "%1"=="-h" (
goto :display_help
)
if "%1"=="--help" (
goto :display_help
)
if "%1"=="" (
goto :display_help
)
if "%1"=="trace" (
if "%2"=="" (
curl -o trace.out http://localhost:6060/debug/pprof/trace
go tool trace trace.out
goto :quit
) else (
curl -o trace.out http://localhost:6060/debug/pprof/trace?seconds=%2
go tool trace trace.out
goto :quit
)
)
if "%2"=="" (
go tool pprof -http=:6969 fnf-practice.exe http://localhost:6060/debug/pprof/%1
) else (
go tool pprof -http=:6969 fnf-practice.exe http://localhost:6060/debug/pprof/%1?seconds=%2
)
goto :quit
:display_help
echo batch file for pprof
echo usage pprof to-profile time
echo -
echo things to profile
echo allocs
echo block
echo cmdline
echo goroutine
echo heap
echo mutex
echo profile
echo threadcreate
echo trace
:quit