https://github.com/esap/echopprof
https://github.com/esap/echopprof
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/esap/echopprof
- Owner: esap
- License: mit
- Created: 2018-04-19T07:29:51.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-19T07:34:34.000Z (over 8 years ago)
- Last Synced: 2024-06-20T02:12:52.278Z (about 2 years ago)
- Language: Go
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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/esap/vendor/echopprof
```
# Usage
```
package main
import (
"github.com/labstack/echo"
"github.com/labstack/echo/engine/standard"
"github.com/esap/vendor/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.