xpprof

package module
v0.0.0-...-3ef395b Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

README

pprof

goclub/http 的 pprof 分析工具

package main

import xhttp "github.com/goclub/http"
import xpprof "github.com/goclub/pprof"
import log "log"
import http "net/http"

func main () {
    r := xhttp.NewRouter(xhttp.RouterOption{})
    server := &http.Server{
        Addr: ":5241",
        Handler: r,
    }
    xpprof.RegisterHttp(r.NetHttpHandleFunc)
	log.Print("http://localhost" + server.Addr + "/debug/")
	log.Printf("%+v", server.ListenAndServe())
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHttp

func RegisterHttp(handleFunc func(path string, handler func(w http.ResponseWriter, r *http.Request)))

Types

This section is empty.

Jump to

Keyboard shortcuts

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