在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:pkg/profile开源软件地址:https://github.com/pkg/profile开源编程语言:Go 100.0%开源软件介绍:profileSimple profiling support package for Go installation
usageEnabling profiling in your application is as simple as one line at the top of your main function import "github.com/pkg/profile"
func main() {
defer profile.Start().Stop()
...
} optionsWhat to profile is controlled by config value passed to profile.Start. By default CPU profiling is enabled. import "github.com/pkg/profile"
func main() {
// p.Stop() must be called before the program exits to
// ensure profiling information is written to disk.
p := profile.Start(profile.MemProfile, profile.ProfilePath("."), profile.NoShutdownHook)
...
// You can enable different kinds of memory profiling, either Heap or Allocs where Heap
// profiling is the default with profile.MemProfile.
p := profile.Start(profile.MemProfileAllocs, profile.ProfilePath("."), profile.NoShutdownHook)
} Several convenience package level values are provided for cpu, memory, and block (contention) profiling. For more complex options, consult the documentation. contributingWe welcome pull requests, bug fixes and issue reports. Before proposing a change, please discuss it first by raising an issue. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论