profile

Simple profiling for Go

  • Owner: pkg/profile
  • Platform:
  • License:: BSD 2-Clause "Simplified" License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

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.

Main metrics

Overview
Name With Ownerpkg/profile
Primary LanguageGo
Program languageGo (Language Count: 1)
Platform
License:BSD 2-Clause "Simplified" License
所有者活动
Created At2014-10-22 01:35:18
Pushed At2022-10-20 20:16:29
Last Commit At2022-10-20 12:34:01
Release Count9
Last Release Namev1.7.0 (Posted on )
First Release Namev1.0.0 (Posted on 2015-09-01 13:52:28)
用户参与
Stargazers Count2k
Watchers Count38
Fork Count122
Commits Count129
Has Issues Enabled
Issues Count31
Issue Open Count9
Pull Requests Count28
Pull Requests Open Count2
Pull Requests Close Count6
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private