profile

Simple profiling for Go

  • 所有者: pkg/profile
  • 平台:
  • 许可证: BSD 2-Clause "Simplified" License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

profile

Simple profiling support package for Go

Build Status GoDoc

installation

go get github.com/pkg/profile

usage

Enabling 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()
    ...
}

options

What 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)
    ...
}

Several convenience package level values are provided for cpu, memory, and block (contention) profiling.

For more complex options, consult the documentation.

contributing

We welcome pull requests, bug fixes and issue reports.

Before proposing a change, please discuss it first by raising an issue.

主要指标

概览
名称与所有者pkg/profile
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证BSD 2-Clause "Simplified" License
所有者活动
创建于2014-10-22 01:35:18
推送于2022-10-20 20:16:29
最后一次提交2022-10-20 12:34:01
发布数9
最新版本名称v1.7.0 (发布于 )
第一版名称v1.0.0 (发布于 2015-09-01 13:52:28)
用户参与
星数2k
关注者数38
派生数122
提交数129
已启用问题?
问题数31
打开的问题数9
拉请求数28
打开的拉请求数2
关闭的拉请求数6
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?