All Projects → DeanThompson → Ginpprof

DeanThompson / Ginpprof

Licence: mit
A wrapper for golang web framework gin to use net/http/pprof easily.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Labels

Projects that are alternatives of or similar to Ginpprof

golang-gin-restfulAPI-example-app
An example Golang Restful API with [Gin, MongoDB, gin-jwt, gin-sessions, gin-authz, gin-swagger, validate.v9, casbin, go-ini]
Stars: ✭ 104 (-62.59%)
Mutual labels:  gin
gin-status-api
Golang cpu, memory, gc, etc information api handler written in Go (Golang) for gin framework
Stars: ✭ 21 (-92.45%)
Mutual labels:  gin
lyanna
go的gin框架实现一个博客系统
Stars: ✭ 39 (-85.97%)
Mutual labels:  gin
gin-rest-prisma-boilerplate
🍱 backend with gin (golang web framework), redis, prisma, rbac, and authentication
Stars: ✭ 25 (-91.01%)
Mutual labels:  gin
7yue api server
旧岛小程序的 api server
Stars: ✭ 48 (-82.73%)
Mutual labels:  gin
todo-app
🔥 REST API для приложения списков ToDo
Stars: ✭ 78 (-71.94%)
Mutual labels:  gin
go-hexagonal http api-course
Ejemplos del curso de API HTTP en Go aplicando Arquitectura Hexagonal
Stars: ✭ 78 (-71.94%)
Mutual labels:  gin
Go Blog
Golang+gin+vue+MySQL blog
Stars: ✭ 256 (-7.91%)
Mutual labels:  gin
druid-prometheus-exporter
Service to collect Apache Druid metrics and export them to Prometheus
Stars: ✭ 14 (-94.96%)
Mutual labels:  gin
egoshop
An e-shop is written by Go
Stars: ✭ 86 (-69.06%)
Mutual labels:  gin
go-gin-web-server
Deploy Go Gin on Render
Stars: ✭ 23 (-91.73%)
Mutual labels:  gin
dolphin
Automated code tool for Golang
Stars: ✭ 27 (-90.29%)
Mutual labels:  gin
gin-sample
gin sample
Stars: ✭ 32 (-88.49%)
Mutual labels:  gin
gin-rest-api
Example golang using gin framework everything you need, i create this tutorial special for beginner.
Stars: ✭ 56 (-79.86%)
Mutual labels:  gin
gogrpcgin
golang grpc gin
Stars: ✭ 33 (-88.13%)
Mutual labels:  gin
Go-bjut
A bbs system.
Stars: ✭ 60 (-78.42%)
Mutual labels:  gin
goft-gin
基于gin的开发脚手架
Stars: ✭ 108 (-61.15%)
Mutual labels:  gin
Mdblog
用来显示 markdown 文档的,基于 gin 框架的, go 语言开发的博客
Stars: ✭ 264 (-5.04%)
Mutual labels:  gin
golang api
This is a source code of my golang restful api series on youtube.
Stars: ✭ 36 (-87.05%)
Mutual labels:  gin
gin-swagger
DRY templates for go-swagger
Stars: ✭ 79 (-71.58%)
Mutual labels:  gin

ginpprof

GoDoc Build Status

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

Install

First install ginpprof to your GOPATH using go get:

go get github.com/DeanThompson/ginpprof

Usage

package main

import (
	"github.com/gin-gonic/gin"

	"github.com/DeanThompson/ginpprof"
)

func main() {
	router := gin.Default()

	router.GET("/ping", func(c *gin.Context) {
		c.String(200, "pong")
	})

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

	// ginpprof also plays well with *gin.RouterGroup
	// group := router.Group("/debug/pprof")
	// ginpprof.WrapGroup(group)

	router.Run(":8080")
}

Start this server, and you will see such outputs:

[GIN-debug] GET    /ping                     --> main.main.func1 (3 handlers)
[GIN-debug] GET    /debug/pprof/             --> github.com/DeanThompson/ginpprof.IndexHandler.func1 (3 handlers)
[GIN-debug] GET    /debug/pprof/heap         --> github.com/DeanThompson/ginpprof.HeapHandler.func1 (3 handlers)
[GIN-debug] GET    /debug/pprof/goroutine    --> github.com/DeanThompson/ginpprof.GoroutineHandler.func1 (3 handlers)
[GIN-debug] GET    /debug/pprof/block        --> github.com/DeanThompson/ginpprof.BlockHandler.func1 (3 handlers)
[GIN-debug] GET    /debug/pprof/threadcreate --> github.com/DeanThompson/ginpprof.ThreadCreateHandler.func1 (3 handlers)
[GIN-debug] GET    /debug/pprof/cmdline      --> github.com/DeanThompson/ginpprof.CmdlineHandler.func1 (3 handlers)
[GIN-debug] GET    /debug/pprof/profile      --> github.com/DeanThompson/ginpprof.ProfileHandler.func1 (3 handlers)
[GIN-debug] GET    /debug/pprof/symbol       --> github.com/DeanThompson/ginpprof.SymbolHandler.func1 (3 handlers)
[GIN-debug] POST   /debug/pprof/symbol       --> github.com/DeanThompson/ginpprof.SymbolHandler.func1 (3 handlers)
[GIN-debug] GET    /debug/pprof/trace        --> github.com/DeanThompson/ginpprof.TraceHandler.func1 (3 handlers)
[GIN-debug] GET    /debug/pprof/mutex        --> github.com/DeanThompson/ginpprof.MutexHandler.func1 (3 handlers)
[GIN-debug] Listening and serving HTTP on :8080

Now visit http://127.0.0.1:8080/debug/pprof/ and you'll see what you want.

Have Fun.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].