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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?