pprofx

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

README

gin_pprof

use
package main

import (
	"https://github.com/climber-dong/global/core/pprofx"
	"github.com/gin-gonic/gin"
)

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

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

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

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

	router.Run(":8080")
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Wrapper = Wrap

Wrapper make sure we are backward compatible

Functions

func AllocsHandler

func AllocsHandler() gin.HandlerFunc

AllocsHandler will pass the call from /debug/pprofx/allocs to pprofx

func BlockHandler

func BlockHandler() gin.HandlerFunc

BlockHandler will pass the call from /debug/pprofx/block to pprofx

func CmdlineHandler

func CmdlineHandler() gin.HandlerFunc

CmdlineHandler will pass the call from /debug/pprofx/cmdline to pprofx

func GoroutineHandler

func GoroutineHandler() gin.HandlerFunc

GoroutineHandler will pass the call from /debug/pprofx/goroutine to pprofx

func HeapHandler

func HeapHandler() gin.HandlerFunc

HeapHandler will pass the call from /debug/pprofx/heap to pprofx

func IndexHandler

func IndexHandler() gin.HandlerFunc

IndexHandler will pass the call from /debug/pprofx to pprofx

func MutexHandler

func MutexHandler() gin.HandlerFunc

MutexHandler will pass the call from /debug/pprofx/mutex to pprofx

func ProfileHandler

func ProfileHandler() gin.HandlerFunc

ProfileHandler will pass the call from /debug/pprofx/profile to pprofx

func SymbolHandler

func SymbolHandler() gin.HandlerFunc

SymbolHandler will pass the call from /debug/pprofx/symbol to pprofx

func ThreadCreateHandler

func ThreadCreateHandler() gin.HandlerFunc

ThreadCreateHandler will pass the call from /debug/pprofx/threadcreate to pprofx

func TraceHandler

func TraceHandler() gin.HandlerFunc

TraceHandler will pass the call from /debug/pprofx/tracex to pprofx

func Wrap

func Wrap(router *gin.Engine)

Wrap adds several routes from package `net/http/pprofx` to *gin.Engine object

func WrapGroup

func WrapGroup(router *gin.RouterGroup)

WrapGroup adds several routes from package `net/http/pprofx` to *gin.RouterGroup object

Types

This section is empty.

Jump to

Keyboard shortcuts

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