{"id":23272715,"url":"https://github.com/handsomestwei/go-pprof-tool","last_synced_at":"2025-04-06T09:53:58.542Z","repository":{"id":114069612,"uuid":"334608713","full_name":"handsomestWei/go-pprof-tool","owner":"handsomestWei","description":"golang pprof性能分析监控工具使用","archived":false,"fork":false,"pushed_at":"2021-01-31T08:37:54.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T16:45:59.137Z","etag":null,"topics":["go-tool","golang","pprof"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/handsomestWei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-31T08:33:47.000Z","updated_at":"2021-04-13T09:35:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"27e1acad-3bc4-445e-abff-716de0e4d6e6","html_url":"https://github.com/handsomestWei/go-pprof-tool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handsomestWei%2Fgo-pprof-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handsomestWei%2Fgo-pprof-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handsomestWei%2Fgo-pprof-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handsomestWei%2Fgo-pprof-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/handsomestWei","download_url":"https://codeload.github.com/handsomestWei/go-pprof-tool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247463934,"owners_count":20942951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go-tool","golang","pprof"],"created_at":"2024-12-19T19:18:36.479Z","updated_at":"2025-04-06T09:53:58.526Z","avatar_url":"https://github.com/handsomestWei.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-pprof-tool\ngolang pprof性能分析监控工具使用\n\n# Usages\n提供两种方式\n+ http接口访问\n+ 采集到文件\n\n## http接口访问\n```\nimport (\n\t\"github.com/handsomestWei/go-pprof-tool/pprof\"\n)\n\n// 暴露端口提供http接口访问\npprof.RunAtAddrAndPort(\"addr:port\")\n```\n采集信息页面\n```\nhttp://addr:port/debug/pprof/\n```\n下载采集文件\n```\ngo tool pprof http://addr:port/debug/pprof/profile?seconds=30\n```\n## 采集到文件\n```\nimport (\n\t\"github.com/handsomestWei/go-pprof-tool/pprof\"\n)\n\n// 指定采集文件输出目录，和采集持续时间\npprof.Dump2FileDuration(\"./cpu.prof\", 10*time.Second)\n```\n打开采集文件\n```\ngo tool pprof [filePath]\n```\n## 采集文件解析\n```\ngo tool pprof [filePath] [command]\n```\n### top命令\n关注sum%列：给定函数累积使用cpu总比例\n### list命令\n定位到可能有问题的代码段\n```\nlist [function name]\n例：list BlockDefault\n```\n### web命令\n[需要安装工具](http://www.graphviz.org/download/)\n生成调用链\n### exit命令\n退出","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhandsomestwei%2Fgo-pprof-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhandsomestwei%2Fgo-pprof-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhandsomestwei%2Fgo-pprof-tool/lists"}