Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.9 KB

File metadata and controls

60 lines (42 loc) · 1.9 KB
id fgprof

Fgprof

Release Discord Test

fgprof support for Fiber.

Compatible with Fiber v3.

Go version support

We only support the latest two versions of Go. Visit https://go.dev/doc/devel/release for more information.

Install

Using fgprof to profiling your Fiber app.

go get -u github.com/gofiber/fiber/v3
go get -u github.com/gofiber/contrib/v3/fgprof

Config

Property Type Description Default
Next func(c fiber.Ctx) bool A function to skip this middleware when returned true. nil
Prefix string. Prefix defines a URL prefix added before "/debug/fgprof". Note that it should start with (but not end with) a slash. Example: "/federated-fiber" ""

Example

package main

import (
    "log"

    "github.com/gofiber/contrib/v3/fgprof"
    "github.com/gofiber/fiber/v3"
)

func main() {
    app := fiber.New()
    app.Use(fgprof.New())
    app.Get("/", func(c fiber.Ctx) error {
        return c.SendString("OK")
    })
    log.Fatal(app.Listen(":3000"))
}
go tool pprof -http=:8080 http://localhost:3000/debug/fgprof