{"id":13793971,"url":"https://github.com/gin-contrib/pprof","last_synced_at":"2025-05-14T20:04:58.821Z","repository":{"id":13902532,"uuid":"75232830","full_name":"gin-contrib/pprof","owner":"gin-contrib","description":"gin pprof middleware","archived":false,"fork":false,"pushed_at":"2024-06-13T07:57:08.000Z","size":86,"stargazers_count":641,"open_issues_count":3,"forks_count":59,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-10-29T14:54:36.350Z","etag":null,"topics":["gin-gonic","gin-middleware","pprof"],"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/gin-contrib.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":"2016-11-30T22:29:09.000Z","updated_at":"2024-10-04T09:31:39.000Z","dependencies_parsed_at":"2024-04-19T14:43:08.102Z","dependency_job_id":"cf92b2ee-a2bd-47c5-9b35-7e82808e838a","html_url":"https://github.com/gin-contrib/pprof","commit_stats":{"total_commits":79,"total_committers":12,"mean_commits":6.583333333333333,"dds":0.240506329113924,"last_synced_commit":"07723d045fac334f8a22aa2a247c2d8c33886c2f"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gin-contrib%2Fpprof","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gin-contrib%2Fpprof/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gin-contrib%2Fpprof/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gin-contrib%2Fpprof/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gin-contrib","download_url":"https://codeload.github.com/gin-contrib/pprof/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161255,"owners_count":21057553,"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":["gin-gonic","gin-middleware","pprof"],"created_at":"2024-08-03T23:00:34.085Z","updated_at":"2025-04-10T04:54:01.944Z","avatar_url":"https://github.com/gin-contrib.png","language":"Go","readme":"# pprof\n\n[![Run Tests](https://github.com/gin-contrib/pprof/actions/workflows/go.yml/badge.svg?branch=master)](https://github.com/gin-contrib/pprof/actions/workflows/go.yml)\n[![codecov](https://codecov.io/gh/gin-contrib/pprof/branch/master/graph/badge.svg)](https://codecov.io/gh/gin-contrib/pprof)\n[![Go Report Card](https://goreportcard.com/badge/github.com/gin-contrib/pprof)](https://goreportcard.com/report/github.com/gin-contrib/pprof)\n[![GoDoc](https://godoc.org/github.com/gin-contrib/pprof?status.svg)](https://godoc.org/github.com/gin-contrib/pprof)\n\ngin pprof middleware\n\n\u003e Package pprof serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool.\n\n## Usage\n\n### Start using it\n\nDownload and install it:\n\n```bash\ngo get github.com/gin-contrib/pprof\n```\n\nImport it in your code:\n\n```go\nimport \"github.com/gin-contrib/pprof\"\n```\n\n### Example\n\n```go\npackage main\n\nimport (\n  \"github.com/gin-contrib/pprof\"\n  \"github.com/gin-gonic/gin\"\n)\n\nfunc main() {\n  router := gin.Default()\n  pprof.Register(router)\n  router.Run(\":8080\")\n}\n```\n\n### change default path prefix\n\n```go\nfunc main() {\n  router := gin.Default()\n  // default is \"debug/pprof\"\n  pprof.Register(router, \"dev/pprof\")\n  router.Run(\":8080\")\n}\n```\n\n### custom router group\n\n```go\npackage main\n\nimport (\n  \"net/http\"\n\n  \"github.com/gin-contrib/pprof\"\n  \"github.com/gin-gonic/gin\"\n)\n\nfunc main() {\n  router := gin.Default()\n  debugGroup := router.Group(\"/debug\", func(c *gin.Context) {\n    if c.Request.Header.Get(\"Authorization\") != \"foobar\" {\n      c.AbortWithStatus(http.StatusForbidden)\n      return\n    }\n    c.Next()\n  })\n  pprof.RouteRegister(debugGroup, \"pprof\")\n  router.Run(\":8080\")\n}\n\n```\n\n### Use the pprof tool\n\nThen use the pprof tool to look at the heap profile:\n\n```bash\ngo tool pprof http://localhost:8080/debug/pprof/heap\n```\n\nOr to look at a 30-second CPU profile:\n\n```bash\ngo tool pprof http://localhost:8080/debug/pprof/profile?seconds=30\n```\n\nOr to look at the goroutine blocking profile, after calling runtime.SetBlockProfileRate in your program:\n\n```bash\ngo tool pprof http://localhost:8080/debug/pprof/block\n```\n\nOr to collect a 5-second execution trace:\n\n```bash\nwget http://localhost:8080/debug/pprof/trace?seconds=5\n```\n\nDownload the pprof profile data:\n\n```bash\ncurl -v -H \"Authorization: foobar\" -o profile.pb.gz \\\n  http://localhost:8080/debug/pprof/profile?seconds=60\ngo tool pprof -http=:8099 profile.pb.gz\n```\n","funding_links":[],"categories":["Middlewares","Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgin-contrib%2Fpprof","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgin-contrib%2Fpprof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgin-contrib%2Fpprof/lists"}