profiling

package
v0.4.19 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupPprofHttpServer

func SetupPprofHttpServer(port *uint16) *http.Server

SetupPprofHttpServer does two things:

  1. Because importing "net/http/pprof" automatically binds profiling endpoints to http.DefaultServeMux, this function replaces http.DefaultServeMux with a new mux. This to ensure profiling endpoints are exposed on a separate mux available only from localhost.Hence, this function should be called before adding any other endpoints to http.DefaultServeMux.
  2. If port is non-nil, returns a http server serving net/http/pprof endpoints on localhost:port. If port is nil, returns nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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