Introduction to VPS and Web Technology Development

pprof 使用

自由vps golang
go tool pprof http://localhost:82/debug/pprof/profile
Fetching profile over HTTP from http://localhost:82/debug/pprof/profile
http://localhost:82/debug/pprof/profile: Get "http://localhost:82/debug/pprof/profile": dial tcp [::1]:82: connectex: No connection could be made because the target machine actively refused it.
failed to fetch any source profile



启动示例代码:

package main

import (
	"fmt"
	"net/http"
)
import _ "net/http/pprof"

func main() {
	var addTomap = func() {
		//s := []int{1, 2, 3}
		//s2 := make([]int, 0)
		var slice = []int{1}
		var slice2 = make([]int, 0)

		fmt.Printf("%p n", slice)
		fmt.Printf("%p", slice2)

	}
	addTomap()
	http.ListenAndServe(":81", nil)
}


启动上述代码服务 

访问:http://localhost:81/debug/pprof/                     

使用chatGPT寻求答案
标签: 暂无标签

免责声明:

本站提供的资源,都来自网络,版权争议与本站无关,所有内容及软件的文章仅限用于学习和研究目的。不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负,我们不保证内容的长久可用性,通过使用本站内容随之而来的风险与本站无关,您必须在下载后的24个小时之内,从您的电脑/手机中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。侵删请致信E-mail:master@freevpsweb.com

同类推荐
评论列表