Echo Pprof Save

echo-pprof is a wrapper for golang web framework echo to use net/http/pprof easily.

Project README

echo-pprof

A wrapper for Echo web framework to use net/http/pprof easily.

Install

go get -u github.com/sevenNt/echo-pprof

Usage

package main

import (
	"github.com/labstack/echo/v4"
	"github.com/sevenNt/echo-pprof"
)

func main() {
	e := echo.New()

	e.GET("/ping", func(c echo.Context) error {
		return c.String(200, "pong")
	})

	// automatically add routers for net/http/pprof
	// e.g. /debug/pprof, /debug/pprof/heap, etc.
	echopprof.Wrap(e)

	// echopprof also plays well with *echo.Group
	// prefix := "/debug/pprof"
	// group := e.Group(prefix)
	// echopprof.WrapGroup(prefix, group)

	e.Start(":8080")
}

Start this server, and then visit http://127.0.0.1:8080/debug/pprof/, and you'll see the pprof index page.

Have fun.

Open Source Agenda is not affiliated with "Echo Pprof" Project. README Source: sevennt/echo-pprof
Stars
78
Open Issues
3
Last Commit
6 months ago
Repository
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating