pprof

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MIT Imports: 3 Imported by: 0

README

pprof

pprof is a Go package that provides a set of HTTP handlers for profiling Go programs. It is built on top of the standard net/http/pprof package and is designed to work with the lightning web framework.

Installation

go get github.com/lightning-contrib/pprof

Usage

Here is an example of how to use this package:

package main

import (
	"github.com/go-labx/lightning"
	"github.com/lightning-contrib/pprof"
)

func main() {
	app := lightning.DefaultApp()
	pprof.Register(app)
	app.Run()
}

By default, the package's HTTP handlers are registered under the /debug/pprof prefix. You can customize the prefix by passing an optional argument to the Register function

pprof.Register(app, "/admin/debug/pprof")

Once the package's HTTP handlers are registered, you can access them using a web browser or a command-line tool like go tool pprof. Here are some examples:

Note that the above URLs assume that your lightning application is running on localhost and listening on port 6789. If your application is running on a different host or port, you need to adjust the URLs accordingly.

API Documentation

For detailed API documentation and usage examples, please refer to the documentation.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for more information.

License

This package is licensed under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(app *lightning.Application, prefixOptions ...string)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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