ripplepprof

package
v1.3.21 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 2 Imported by: 0

README

echopprof

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

install

First install echopprof to your GOPATH using go get:

go get github.com/echo-contrib/echopprof

Usage

package main

import (
    "github.com/labstack/echo"

    "github.com/echo-contrib/echopprof"
)

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

    e.Get("/", func(c *echo.Context) error {
        return c.String(200, "hello")
    })

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

    e.Run(":8080")
}

Start this server, and now visit http://127.0.0.1:8090/debug/pprof/ and you'll see what you want.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Wrapper = Wrap

Functions

func BlockHandler

func BlockHandler(ctx echo.Context) error

func CmdlineHandler

func CmdlineHandler(ctx echo.Context) error

func GoroutineHandler

func GoroutineHandler(ctx echo.Context) error

func HeapHandler

func HeapHandler(ctx echo.Context) error

func IndexHandler

func IndexHandler(ctx echo.Context) error

func ProfileHandler

func ProfileHandler(ctx echo.Context) error

func SymbolHandler

func SymbolHandler(ctx echo.Context) error

func ThreadCreateHandler

func ThreadCreateHandler(ctx echo.Context) error

func Wrap

func Wrap(e *echo.Echo)

Types

This section is empty.

Jump to

Keyboard shortcuts

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