Back to

Package fgprof

Latest Go to latest

The latest major version is .

Published: Jul 12, 2020 | License: MIT | Module:


fgprof is a sampling Go profiler that allows you to analyze On-CPU as well as [Off-CPU]( (e.g. I/O) time together.


func Handler

func Handler() http.Handler

Handler returns an http handler that takes an optional "seconds" query argument that defaults to "30" and produces a profile over this duration. The optional "format" parameter controls if the output is written in Google's "pprof" format (default) or Brendan Gregg's "folded" stack format.

func Start

func Start(w io.Writer, format Format) func() error

Start begins profiling the goroutines of the program and returns a function that needs to be invoked by the caller to stop the profiling and write the results to w using the given format.

type Format

type Format string
const (
	// FormatFolded is used by Brendan Gregg's FlameGraph utility, see
	FormatFolded Format = "folded"
	// FormatPprof is used by Google's pprof utility, see
	FormatPprof Format = "pprof"

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier