{"id":28165524,"url":"https://github.com/alexdemure/gadpytestprofiler","last_synced_at":"2026-03-02T14:32:52.813Z","repository":{"id":289888714,"uuid":"972507516","full_name":"AlexDemure/gadpytestprofiler","owner":"AlexDemure","description":"A profiler for benchmarking queries, functions, and I/O/network performance, with pydantic outputs.","archived":false,"fork":false,"pushed_at":"2025-04-26T08:25:56.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"production","last_synced_at":"2025-11-06T12:12:47.000Z","etag":null,"topics":["async-profiler","pytest-profiler","python-profiler","sqlalchemy-profiler"],"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/AlexDemure.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-25T07:33:37.000Z","updated_at":"2025-07-30T21:13:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/AlexDemure/gadpytestprofiler","commit_stats":null,"previous_names":["alexdemure/gadpytestprofiler"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AlexDemure/gadpytestprofiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexDemure%2Fgadpytestprofiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexDemure%2Fgadpytestprofiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexDemure%2Fgadpytestprofiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexDemure%2Fgadpytestprofiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexDemure","download_url":"https://codeload.github.com/AlexDemure/gadpytestprofiler/tar.gz/refs/heads/production","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexDemure%2Fgadpytestprofiler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30006346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T14:08:50.421Z","status":"ssl_error","status_checked_at":"2026-03-02T14:08:50.037Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["async-profiler","pytest-profiler","python-profiler","sqlalchemy-profiler"],"created_at":"2025-05-15T12:11:44.106Z","updated_at":"2026-03-02T14:32:52.791Z","avatar_url":"https://github.com/AlexDemure.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/AlexDemure/gadpytestprofiler\"\u003e\n    \u003ca href=\"https://ibb.co/n8cySxCf\"\u003e\u003cimg src=\"https://i.ibb.co/1JqNxF6K/logo.png\" alt=\"logo\" border=\"0\"\u003e\u003c/a\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  A profiler for benchmarking queries, functions, and I/O/network performance, with pydantic outputs.\n\u003c/p\u003e\n\n---\n\n### Installation\n\n```\npip install gadpytestprofiler\n```\n\n### Usage\n\n```python\nimport pytest\nimport asyncio\nimport time\n\nfrom gadpytestprofiler import SqlalchemyProfiler, FunctionProfiler, AsyncFunctionProfiler\n\n\ndef timesleep():\n    time.sleep(1)\n\n\nasync def aiotimesleep():\n    await asyncio.sleep(1)\n\n\n@pytest.mark.asyncio\nasync def test_query_performance(session):\n    query = select(Dummy)\n\n    _, results = await SqlalchemyProfiler(session, query, runs=1).analyze()\n    print(results.json())\n\n    _, results = FunctionProfiler(timesleep).analyze()\n    print(results.json())\n\n    _, results = await AsyncFunctionProfiler(aiotimesleep).analyze()\n    print(results.json())\n```\n\nSqlalchemyProfiler\n```\n{\n  \"query\": {\n    \"sql\": {\n      \"execute\": {\n        \"mean\": 0.02488902601180598,\n        \"median\": 0.02488902601180598,\n        \"stdev\": 0,\n        \"min\": 0.02488902601180598,\n        \"max\": 0.02488902601180598\n      },\n      \"fetch\": {\n        \"mean\": 0.027863386989338323,\n        \"median\": 0.027863386989338323,\n        \"stdev\": 0,\n        \"min\": 0.027863386989338323,\n        \"max\": 0.027863386989338323\n      },\n      \"scalar\": {\n        \"mean\": 0.0004310549993533641,\n        \"median\": 0.0004310549993533641,\n        \"stdev\": 0,\n        \"min\": 0.0004310549993533641,\n        \"max\": 0.0004310549993533641\n      }\n    },\n    \"orm\": {\n      \"execute\": {\n        \"mean\": 0.8350658340204973,\n        \"median\": 0.8350658340204973,\n        \"stdev\": 0,\n        \"min\": 0.8350658340204973,\n        \"max\": 0.8350658340204973\n      },\n      \"fetch\": {\n        \"mean\": 0.05669003300135955,\n        \"median\": 0.05669003300135955,\n        \"stdev\": 0,\n        \"min\": 0.05669003300135955,\n        \"max\": 0.05669003300135955\n      },\n      \"scalar\": {\n        \"mean\": 0.0001957119966391474,\n        \"median\": 0.0001957119966391474,\n        \"stdev\": 0,\n        \"min\": 0.0001957119966391474,\n        \"max\": 0.0001957119966391474\n      }\n    },\n    \"explains\": [\n      {\n        \"plan\": {\n          \"type\": \"Seq Scan\",\n          \"name\": \"dummy\",\n          \"alias\": \"dummy\",\n          \"startup\": 0,\n          \"total\": 168.32,\n          \"plan_rows\": 10432,\n          \"plan_width\": 22,\n          \"actual_rows\": 10000,\n          \"actual_loops\": 1,\n          \"actual_startup_time\": 0.004,\n          \"actual_total_time\": 0.564,\n          \"buffers\": null,\n          \"plans\": [],\n          \"filter\": null,\n          \"index\": null,\n          \"join\": null\n        },\n        \"planning\": 0.139,\n        \"execution\": 0.827\n      }\n    ]\n  },\n  \"allocation\": {\n    \"current\": 14279120,\n    \"peak\": 15467940\n  },\n  \"execution\": {\n    \"cpu\": {\n      \"time\": 27.66541111\n    },\n    \"wall\": {\n      \"time\": 6.109025365000001\n    },\n    \"ratio\": 4.528612905832975\n  },\n  \"garbage\": {\n    \"collected\": 1,\n    \"uncollectable\": 9\n  },\n  \"network\": {\n    \"bytes\": {\n      \"sent\": 1210304,\n      \"received\": 5687195\n    },\n    \"packets\": {\n      \"sent\": 1375,\n      \"received\": 2179\n    }\n  },\n  \"io\": {\n    \"time\": {\n      \"read\": 0,\n      \"write\": 162,\n      \"busy\": 17\n    },\n    \"bytes\": {\n      \"read\": 0,\n      \"write\": 913408\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexdemure%2Fgadpytestprofiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexdemure%2Fgadpytestprofiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexdemure%2Fgadpytestprofiler/lists"}