profiling

package
v0.0.0-...-8d9275d Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Profiler

type Profiler struct {
	// Dir, if set, is the path where profiling data will be written to.
	//
	// Can also be configured with "-profile-output-dir" flag.
	Dir string
	// ProfileCPU, if true, indicates that the profiler should profile the CPU.
	//
	// Requires Dir to be set, since it's where the profiler output is dumped.
	//
	// Can also be set with "-profile-cpu".
	ProfileCPU bool
	// ProfileHeap, if true, indicates that the profiler should profile heap
	// allocations.
	//
	// Requires Dir to be set, since it's where the profiler output is dumped.
	//
	// Can also be set with "-profile-heap".
	ProfileHeap bool
	// contains filtered or unexported fields
}

Profiler helps setup and manage profiling

func (*Profiler) AddFlags

func (p *Profiler) AddFlags(fs *pflag.FlagSet)

AddFlags adds command line flags to common Profiler fields.

func (*Profiler) AddHTTP

func (p *Profiler) AddHTTP(r *mux.Router)

AddHTTP adds HTTP proiling endpoints to the provided Router.

func (*Profiler) DumpSnapshot

func (p *Profiler) DumpSnapshot() error

DumpSnapshot dumps a profile snapshot to the configured output directory. If no output directory is configured, nothing will happen.

func (*Profiler) Start

func (p *Profiler) Start() error

Start starts the Profiler's configured operations. On success, returns a function that can be called to shutdown the profiling server.

Calling Stop is not necessary, but will enable end-of-operation profiling to be gathered.

func (*Profiler) Stop

func (p *Profiler) Stop()

Stop stops the Profiler's operations.

Jump to

Keyboard shortcuts

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