echopprof

package module
v0.0.0-...-578e2d6 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2017 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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/labstack/echo/engine/standard"
    "github.com/echo-contrib/echopprof"
)

func hello() echo.HandlerFunc {
	return func(c echo.Context) error {
		return c.String(200, "Hello, World!\n")
	}
}

func main() {
    e := echo.New()
    e.Get("/", hello())

    // automatically add routers for net/http/pprof
    // e.g. /debug/pprof, /debug/pprof/heap, etc.
    echopprof.Wrapper(e)
    e.Run(standard.New(":8080"))
}

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Wrapper = Wrap

Functions

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