💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
[TOC] ## code <details> <summary>pprof.go</summary> ``` package utils import ( "log" "net/http" "net/http/pprof" ) func init() { http.DefaultServeMux = http.NewServeMux() } func Handle(mux *http.ServeMux) { mux.HandleFunc("/debug/pprof/", pprof.Index) mux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline) mux.HandleFunc("/debug/pprof/profile", pprof.Profile) mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol) mux.HandleFunc("/debug/pprof/trace", pprof.Trace) } func NewServeMux() *http.ServeMux { mux := http.NewServeMux() Handle(mux) return mux } func NewServer(addr string) *http.Server { return &http.Server{ Addr: addr, Handler: NewServeMux(), } } func ListenAndServe(addr string) error { return NewServer(addr).ListenAndServe() } // 调用 RunPprof(":6061") func RunPprof(addr string) { go func() { log.Fatal(ListenAndServe(addr)) }() } ``` </details> <br/>