Skip to content
/ prof Public

basic golang Go targeted profiling of specific functions / situations

License

Notifications You must be signed in to change notification settings

goki/prof

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prof

Provides very basic but effective profiling of targeted functions or code sections, which can often be more informative than generic cpu profiling.

Here's how you use it:

  // somewhere near start of program (e.g., using flag package)
  profFlag := flag.Bool("prof", false, "turn on targeted profiling")
  ...
  flag.Parse()
  prof.Profiling = *profFlag
  ...
  // surrounding the code of interest:
  pr := prof.Start("name of function")
  ... code
  pr.End()
  ...
  // at end or whenever you've got enough data:
  prof.Report(time.Millisecond) // or time.Second or whatever

About

basic golang Go targeted profiling of specific functions / situations

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages