{"id":20316209,"url":"https://github.com/d0k1/pgear","last_synced_at":"2026-05-10T16:02:58.946Z","repository":{"id":83453008,"uuid":"149396862","full_name":"d0k1/pgear","owner":"d0k1","description":"A poor man's PostgreSQL load generator","archived":false,"fork":false,"pushed_at":"2019-03-01T10:26:05.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-16T01:38:28.261Z","etag":null,"topics":["load-testing","postgresql","stress-testing"],"latest_commit_sha":null,"homepage":null,"language":"Groovy","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/d0k1.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":"2018-09-19T05:28:40.000Z","updated_at":"2020-02-20T15:00:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7a2359e-6bb6-4f38-9f09-a334e251024e","html_url":"https://github.com/d0k1/pgear","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/d0k1/pgear","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0k1%2Fpgear","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0k1%2Fpgear/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0k1%2Fpgear/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0k1%2Fpgear/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d0k1","download_url":"https://codeload.github.com/d0k1/pgear/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0k1%2Fpgear/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273961555,"owners_count":25198597,"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","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["load-testing","postgresql","stress-testing"],"created_at":"2024-11-14T18:24:55.680Z","updated_at":"2026-05-10T16:02:53.916Z","avatar_url":"https://github.com/d0k1.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PG Extract And Replay\n\n_A poor man's PostgreSQL load generator_\n\n_plain and simple_\n\n## Prerequisites\nTo tune / profile / stress(load) test a particular postgresql instance you need a postgresql log with queries. The most convinient way to get it is to configure postgresql instance to log every query that executes longer that 2 seconds (it's just an example)\n\n## Step 0\n```\ngroovy Extract.groovy postgresql-Fri.log postgresql.sql\n```\n\nThis command will parse postgesql's log and will generate a file with queries. Most important point of this is that in the end you will have a list of queries that are ready to be execute on same postgresql instance. Queries will have paramters in their places.\n\n## Step 1\n\n```\ngroovy Replay.groovy jdbc:postgresql://localhost:5432/ login password postgresql.sql\n```\n\nThis command will execute queries saved to postgresql.sql in a multithreaded way. As a result you will get a result.csv in current directory with information about queries execution.\n\n## Step 2\n\nYou can gather descriptive statistic via your favourite tool or you can use Histrogram.groovy\n\n## Step 3\n\nAfter `Step 2` you'll have result.csv file. Every line of that file will contain a query id and it's execution time. But due to multithreaded execution order of queries in a result.csv usually doesn't correspond to postgresql.sql queries order. So to find what is a query with id 32 for example you could use a `QueryIndex.groovy`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd0k1%2Fpgear","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd0k1%2Fpgear","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd0k1%2Fpgear/lists"}