fiber/middleware/pprof
M. Efe Çetin 691d2e6ad5
🗑️ deprecate: go 1.14 & go 1.15 support deprecation (#2172)
* 🗑️ deprecate: go 1.14 & go 1.15 support deprecation
https://github.com/valyala/fasthttp/pull/1379

* fix tests
2022-10-26 11:51:50 +02:00
..
README.md feature: add Next to Pprof and Expvar middlewares. (#1737) 2022-01-29 22:24:32 +01:00
config.go feature: add Next to Pprof and Expvar middlewares. (#1737) 2022-01-29 22:24:32 +01:00
pprof.go feature: add Next to Pprof and Expvar middlewares. (#1737) 2022-01-29 22:24:32 +01:00
pprof_test.go 🗑️ deprecate: go 1.14 & go 1.15 support deprecation (#2172) 2022-10-26 11:51:50 +02:00

README.md

Pprof

Pprof middleware for Fiber that serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool. The package is typically only imported for the side effect of registering its HTTP handlers. The handled paths all begin with /debug/pprof/.

Signatures

func New() fiber.Handler

Examples

Import the middleware package that is part of the Fiber web framework

import (
  "github.com/gofiber/fiber/v2"
  "github.com/gofiber/fiber/v2/middleware/pprof"
)

After you initiate your Fiber app, you can use the following possibilities:

// Default middleware
app.Use(pprof.New())

Config

// Config defines the config for middleware.
type Config struct {	
	// Next defines a function to skip this middleware when returned true.
	//
	// Optional. Default: nil
	Next func(c *fiber.Ctx) bool
}

Default Config

var ConfigDefault = Config{
	Next: nil,
}