httpFetcher

package
v0.0.0-...-d2aa527 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2014 License: MIT Imports: 9 Imported by: 2

Documentation

Overview

This package implements an interface to interact with the http server behind net/http/pprof We don't need to worry too much about the implementation on the backend, just the interface to it

TODO worry about timeouts on long profiles TODO allow the http fetcher to run profiles for different lengths of time

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

type Fetcher interface {
	// obtain a readable profile
	GetProfile() (io.Reader, error)

	// obtain information about a given function pointer
	GetFunctionNames(fnPtrs []uint64) (map[uint64]string, error)
}

type HttpFetcher

type HttpFetcher struct {
	// default: localhost
	Server string
	// default: 6060
	Port uint
	// default: 30s
	ProfileDuration time.Duration
}

Fetches Pprof results from the standard golang pprof server

func (*HttpFetcher) GetFunctionNames

func (f *HttpFetcher) GetFunctionNames(fnPtrs []uint64) (map[uint64]string, error)

Fetch symbols from /debug/pprof/symbol Use a POST request, with function pointers separated by + symbols the response uses the following formatting - "%#x %s\n" for each function pointer and name (see: Symbol in pprof.go)

func (*HttpFetcher) GetProfile

func (f *HttpFetcher) GetProfile() (io.Reader, error)

Fetch a new profile from the http server

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL