prof

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 3 Imported by: 0

README

prof

封装官方net/http/pprof路由,添加profile io wait time路由。


使用示例

	r := gin.Default()
	prof.Register(r, WithPrefix("/myServer"), WithIOWaitTime())

	httpServer := &http.Server{
		Addr:    ":8080",
		Handler: r,
	}
	
    if err := httpServer.ListenAndServe(); err != nil && err != http.ErrServerClosed {
        panic("listen and serve error: " + err.Error())
    }

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(r *gin.Engine, opts ...Option)

Register pprof for gin router

Types

type Option

type Option func(o *options)

Option set defaultPrefix func

func WithIOWaitTime

func WithIOWaitTime() Option

WithIOWaitTime enable IO wait time

func WithPrefix

func WithPrefix(prefix string) Option

WithPrefix set route defaultPrefix

Jump to

Keyboard shortcuts

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