pprof

package
v1.4.25 Latest Latest
Warning

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

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

Documentation

Overview

Package pprof provides pprof handler options for httpserver module.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithProfiling

func WithProfiling() httpserver.Opt

WithProfiling replaces servers handler with http.DefaultServeMux which is instrumented with profiling endpoints by net/http/pprof. This option is meant be used with stand alone profiling server, not embedded inside application server. For serving profiling endpoints inside your application web server see https://pkg.go.dev/net/http/pprof.

Example
package main

import (
	"github.com/elisasre/go-common/service/module/httpserver"
	"github.com/elisasre/go-common/service/module/httpserver/pprof"
)

func main() {
	httpserver.New(
		httpserver.WithAddr(":6062"),
		pprof.WithProfiling(),
	)
}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

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