{"id":20100867,"url":"https://github.com/jijun/fastapi-cprofile","last_synced_at":"2025-05-06T06:32:39.447Z","repository":{"id":57428472,"uuid":"324322539","full_name":"Jijun/fastapi-cprofile","owner":"Jijun","description":"A FastAPI Middleware with cProfile to help stats your service performance","archived":false,"fork":false,"pushed_at":"2023-08-21T13:48:05.000Z","size":5,"stargazers_count":42,"open_issues_count":1,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T18:19:27.090Z","etag":null,"topics":["cprofile","fastapi"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Jijun.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":"2020-12-25T08:32:41.000Z","updated_at":"2025-03-06T05:01:32.000Z","dependencies_parsed_at":"2024-06-19T04:08:59.113Z","dependency_job_id":"7c47e6b3-aaad-409e-979e-e30b98bfd7a2","html_url":"https://github.com/Jijun/fastapi-cprofile","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"243ec5e53efdb29fc21262039f13d4ba1f453fb5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jijun%2Ffastapi-cprofile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jijun%2Ffastapi-cprofile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jijun%2Ffastapi-cprofile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jijun%2Ffastapi-cprofile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jijun","download_url":"https://codeload.github.com/Jijun/fastapi-cprofile/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252633779,"owners_count":21779921,"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":["cprofile","fastapi"],"created_at":"2024-11-13T17:21:51.834Z","updated_at":"2025-05-06T06:32:39.215Z","avatar_url":"https://github.com/Jijun.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastapi-cprofile\n\nA FastAPI Middleware with cProfile to help stats your service performance. \ncProfile is a built-in python module that can perform profiling. It is the most commonly used profiler currently.\n\n# Features\n\n- [x] support custom cprofile param\n\n#Installation\n\n```buildoutcfg\n$ pip install fastapi-cprofile\n```\n\n\n# Code Sample\n\n```python\nfrom fastapi_cprofile.profiler import CProfileMiddleware\n\napp = FastAPI()\napp.add_middleware(CProfileMiddleware)\n```\nadd cprofile options\n\n```python\n\nfrom fastapi_cprofile.profiler import CProfileMiddleware\napp = FastAPI()\napp.add_middleware(CProfileMiddleware, enable=True, print_each_request = True, strip_dirs = False, sort_by='cumulative')\n\n```\nor dump out file while shutdown your app then you can use gprof2dot [gprof2dot](https://github.com/jrfonseca/gprof2dot) to view it.\n\n```python\n\nfrom fastapi_cprofile.profiler import CProfileMiddleware\napp = FastAPI()\napp.add_middleware(CProfileMiddleware, enable=True, server_app = app, filename='/tmp/output.pstats', strip_dirs = False, sort_by='cumulative')\n\n```\n\n# License\n\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjijun%2Ffastapi-cprofile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjijun%2Ffastapi-cprofile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjijun%2Ffastapi-cprofile/lists"}