{"id":19703572,"url":"https://github.com/monibuca/plugin-debug","last_synced_at":"2025-04-29T14:30:54.302Z","repository":{"id":41894657,"uuid":"462667937","full_name":"Monibuca/plugin-debug","owner":"Monibuca","description":"用于调试程序的插件","archived":false,"fork":false,"pushed_at":"2024-02-21T02:55:20.000Z","size":1011,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"v4","last_synced_at":"2025-04-05T17:51:09.399Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Monibuca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-02-23T09:33:05.000Z","updated_at":"2024-01-23T15:26:31.000Z","dependencies_parsed_at":"2024-01-24T03:24:16.048Z","dependency_job_id":"97dc8dfc-3032-4e1e-a6b1-062c5b563acb","html_url":"https://github.com/Monibuca/plugin-debug","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monibuca%2Fplugin-debug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monibuca%2Fplugin-debug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monibuca%2Fplugin-debug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monibuca%2Fplugin-debug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Monibuca","download_url":"https://codeload.github.com/Monibuca/plugin-debug/tar.gz/refs/heads/v4","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251518847,"owners_count":21602224,"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":[],"created_at":"2024-11-11T21:18:17.047Z","updated_at":"2025-04-29T14:30:50.098Z","avatar_url":"https://github.com/Monibuca.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# debug插件\n\n该插件可以使得pprof通过公共端口访问，并且调用profile可以将CPU分析文件保存为cpu.profile文件，然后自动打开分析UI界面。\n\n## 插件地址\n\nhttps://github.com/Monibuca/plugin-debug\n\n## 插件引入\n```go\nimport (\n    _ \"m7s.live/plugin/debug/v4\"\n)\n```\n\n## API\n\n\n### GET `/debug/pprof`\n打开pprof界面\n\n### GET `/debug/profile`\n默认30s采样，可以通过传入 `?seconds=xxx` 来指定采样时间长度，采样结束后将CPU分析文件保存为cpu.profile文件，并将启动采样展示 web 页面的命令输出到当前页面。比如 `go tool pprof -http :6060 ./monibuca cpu.profile`\n\n在当前monibuca程序目录下，运行命令会自动打开浏览器，展示 profile 调用图。**注意需要先安装graphviz，并添加到环境变量PATH里。**\n\n### GET `/debug/charts`\n展示 CPU、内存、GC、pprof 实时变化可视化图表\n\n### WS `/debug/charts/datafeed`\nws 接口，供`/debug/charts`页面前端拉取数据，不需关心\n\n### GET `/debug/charts/data`\njquery 回调接口，供`/debug/charts`页面前端拉取数据，不需关心\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonibuca%2Fplugin-debug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonibuca%2Fplugin-debug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonibuca%2Fplugin-debug/lists"}