您这个和我在程序中直接 import _ "net/http/pprof" ,然后开一个HTTP服务查看pprof有什么区别啊 。
下面是http://127.0.0.1:6060/debug/pprof/HTTP服务返回的结果
/debug/pprof/
Types of profiles available:
Count Profile
2 allocs
0 block
0 cmdline
1029 goroutine
2 heap
0 mutex
0 profile
16 threadcreate
0 trace
full goroutine stack dump
Profile Descriptions:
allocs: A sampling of all past memory allocations
block: Stack traces that led to blocking on synchronization primitives
cmdline: The command line invocation of the current program
goroutine: Stack traces of all current goroutines
heap: A sampling of memory allocations of live objects. You can specify the gc GET parameter to run GC before taking the heap sample.
mutex: Stack traces of holders of contended mutexes
profile: CPU profile. You can specify the duration in the seconds GET parameter. After you get the profile file, use the go tool pprof command to investigate the profile.
threadcreate: Stack traces that led to the creation of new OS threads
trace: A trace of execution of the current program. You can specify the duration in the seconds GET parameter. After you get the trace file, use the go tool trace command to investigate the trace.
展开