pprof

Imports

Imports #

"bufio"
"bytes"
"context"
"fmt"
"html"
"internal/godebug"
"internal/profile"
"io"
"log"
"net/http"
"net/url"
"os"
"runtime"
"runtime/pprof"
"runtime/trace"
"slices"
"strconv"
"strings"
"time"

Constants & Variables

profileDescriptions var #

var profileDescriptions = map[string]string{...}

profileSupportsDelta var #

var profileSupportsDelta = map[handler]bool{...}

Type Aliases

handler type #

type handler string

Structs

profileEntry struct #

type profileEntry struct {
Name string
Href string
Desc string
Count int
}

Functions

Cmdline function #

Cmdline responds with the running program's command line, with arguments separated by NUL bytes. The package initialization registers it as /debug/pprof/cmdline.

func Cmdline(w http.ResponseWriter, r *http.Request)

Handler function #

Handler returns an HTTP handler that serves the named profile. Available profiles can be found in [runtime/pprof.Profile].

func Handler(name string) http.Handler

Index function #

Index responds with the pprof-formatted profile named by the request. For example, "/debug/pprof/heap" serves the "heap" profile. Index responds to a request for "/debug/pprof/" with an HTML page listing the available profiles.

func Index(w http.ResponseWriter, r *http.Request)

Profile function #

Profile responds with the pprof-formatted cpu profile. Profiling lasts for duration specified in seconds GET parameter, or for 30 seconds if not specified. The package initialization registers it as /debug/pprof/profile.

func Profile(w http.ResponseWriter, r *http.Request)

ServeHTTP method #

func (name handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Symbol function #

Symbol looks up the program counters listed in the request, responding with a table mapping program counters to function names. The package initialization registers it as /debug/pprof/symbol.

func Symbol(w http.ResponseWriter, r *http.Request)

Trace function #

Trace responds with the execution trace in binary form. Tracing lasts for duration specified in seconds GET parameter, or for 1 second if not specified. The package initialization registers it as /debug/pprof/trace.

func Trace(w http.ResponseWriter, r *http.Request)

collectProfile function #

func collectProfile(p *pprof.Profile) (*profile.Profile, error)

configureWriteDeadline function #

func configureWriteDeadline(w http.ResponseWriter, r *http.Request, seconds float64)

indexTmplExecute function #

func indexTmplExecute(w io.Writer, profiles []profileEntry) error

init function #

func init()

serveDeltaProfile method #

func (name handler) serveDeltaProfile(w http.ResponseWriter, r *http.Request, p *pprof.Profile, secStr string)

serveError function #

func serveError(w http.ResponseWriter, status int, txt string)

sleep function #

func sleep(r *http.Request, d time.Duration)

Generated with Arrow