{"id":15468625,"url":"https://github.com/winebarrel/qube","last_synced_at":"2025-04-22T11:49:06.331Z","repository":{"id":204232817,"uuid":"711388964","full_name":"winebarrel/qube","owner":"winebarrel","description":"qube is a DB load testing tool.","archived":false,"fork":false,"pushed_at":"2025-04-14T18:57:54.000Z","size":294,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T19:46:33.914Z","etag":null,"topics":["benchmark","golang","mysql","postgresql"],"latest_commit_sha":null,"homepage":"","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/winebarrel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-10-29T05:21:45.000Z","updated_at":"2025-04-14T18:57:57.000Z","dependencies_parsed_at":"2023-11-11T05:33:08.596Z","dependency_job_id":"fa00a554-76c9-47f5-ab8a-e661bcd33057","html_url":"https://github.com/winebarrel/qube","commit_stats":{"total_commits":158,"total_committers":2,"mean_commits":79.0,"dds":"0.19620253164556967","last_synced_commit":"99cefb3652302ef764756b6e4a65ad9858f1a338"},"previous_names":["winebarrel/qube"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winebarrel%2Fqube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winebarrel%2Fqube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winebarrel%2Fqube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winebarrel%2Fqube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/winebarrel","download_url":"https://codeload.github.com/winebarrel/qube/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250237793,"owners_count":21397399,"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":["benchmark","golang","mysql","postgresql"],"created_at":"2024-10-02T01:41:45.408Z","updated_at":"2025-04-22T11:49:06.324Z","avatar_url":"https://github.com/winebarrel.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qube\n\n[![build](https://github.com/winebarrel/qube/actions/workflows/test.yml/badge.svg)](https://github.com/winebarrel/qube/actions/workflows/test.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/winebarrel/qube)](https://goreportcard.com/report/github.com/winebarrel/qube)\n\nqube is a DB load testing tool.\n\n![](https://github.com/user-attachments/assets/ad0078d7-ec2d-4976-b0c3-836e05e557db)\n\n## Installation\n\n```sh\nbrew install winebarrel/qube/qube\n```\n\n## Usage\n\n```\nUsage: qube --data-files=DATA-FILES,... --dsn=STRING [flags]\n\nFlags:\n  -h, --help                Show help.\n      --[no-]force          Do not abort test on error. (default: disabled)\n  -f, --data-files=DATA-FILES,...\n                            JSON Lines file list of queries to execute.\n      --key=\"q\"             Key name of the query field in the test data. e.g.\n                            {\"q\":\"SELECT ...\"}\n      --[no-]loop           Return to the beginning after reading the test data.\n                            (default: enabled)\n      --[no-]random         Randomize the starting position of the test data.\n                            (default: disabled)\n      --commit-rate=UINT    Number of queries to execute \"COMMIT\".\n  -d, --dsn=STRING          DSN to connect to.\n                              - MySQL:\n                                https://pkg.go.dev/github.com/go-sql-driver/mysql#readme-dsn-data-source-name\n                              - PostgreSQL:\n                                https://pkg.go.dev/github.com/jackc/pgx/v5/stdlib#pkg-overview\n      --[no-]noop           No-op mode. No actual query execution. (default:\n                            disabled)\n      --[no-]iam-auth       Use RDS IAM authentication.\n  -n, --nagents=1           Number of agents.\n  -r, --rate=FLOAT-64       Rate limit (qps). \"0\" means unlimited.\n  -t, --time=DURATION       Maximum execution time of the test. \"0\" means\n                            unlimited.\n      --[no-]progress       Show progress report.\n  -C, --[no-]color          Color report JSON.\n      --version\n```\n\n```\n$ echo '{\"q\":\"select 1\"}' \u003e data.jsonl\n$ echo '{\"q\":\"select 2\"}' \u003e\u003e data.jsonl\n$ echo '{\"q\":\"select 3\"}' \u003e\u003e data.jsonl\n\n$ qube -d 'root@tcp(127.0.0.1:13306)/' -f data.jsonl -n 5 -t 10s\n00:05 | 5 agents / exec 95788 queries, 0 errors (23637 qps)\n...\n{\n  \"ID\": \"b1e23c00-1601-46eb-ad2b-fdf01154243d\",\n  \"StartedAt\": \"2023-11-12T12:08:29.296154+09:00\",\n  \"FinishedAt\": \"2023-11-12T12:08:39.297268+09:00\",\n  \"ElapsedTime\": \"10.001173875s\",\n  \"Options\": {\n    \"Force\": false,\n    \"DataFile\": [\n      \"data.jsonl\"\n    ],\n    \"Key\": \"q\",\n    \"Loop\": true,\n    \"Random\": false,\n    \"CommitRate\": 0,\n    \"DSN\": \"root@tcp(127.0.0.1:13306)/\",\n    \"Driver\": \"mysql\",\n    \"Noop\": false,\n    \"IAMAuth\": false,\n    \"Nagents\": 5,\n    \"Rate\": 0,\n    \"Time\": \"10s\"\n  },\n  \"GOMAXPROCS\": 10,\n  \"QueryCount\": 238001,\n  \"ErrorQueryCount\": 0,\n  \"AvgQPS\": 23797,\n  \"MaxQPS\": 24977,\n  \"MinQPS\": 21623,\n  \"MedianQPS\": 24051.5,\n  \"Duration\": {\n    \"Time\": {\n      \"Cumulative\": \"49.569869935s\",\n      \"HMean\": \"200.366µs\",\n      \"Avg\": \"208.275µs\",\n      \"P50\": \"199.75µs\",\n      \"P75\": \"222.042µs\",\n      \"P95\": \"288.875µs\",\n      \"P99\": \"363.375µs\",\n      \"P999\": \"594.208µs\",\n      \"Long5p\": \"349.679µs\",\n      \"Short5p\": \"142.483µs\",\n      \"Max\": \"2.796209ms\",\n      \"Min\": \"98.709µs\",\n      \"Range\": \"2.6975ms\",\n      \"StdDev\": \"54.681µs\"\n    },\n    \"Rate\": {\n      \"Second\": 4801.323875008872\n    },\n    \"Samples\": 238001,\n    \"Count\": 238001,\n    \"Histogram\": [\n      {\n        \"98µs - 368µs\": 235807\n      },\n      {\n        \"368µs - 638µs\": 2008\n      },\n      {\n        \"638µs - 907µs\": 117\n      },\n      {\n        \"907µs - 1.177ms\": 19\n      },\n      {\n        \"1.177ms - 1.447ms\": 9\n      },\n      {\n        \"1.447ms - 1.717ms\": 4\n      },\n      {\n        \"1.717ms - 1.986ms\": 2\n      },\n      {\n        \"1.986ms - 2.256ms\": 3\n      },\n      {\n        \"2.256ms - 2.526ms\": 12\n      },\n      {\n        \"2.526ms - 2.796ms\": 20\n      }\n    ]\n  }\n}\n```\n\n### Comment out in the data file\n\nLines starting with `//` are ignored as comments.\n\n```\n{\"q\":\"select 1\"}\n//comment\n//{\"q\":\"select 2\"}\n{\"q\":\"select 3\"}\n```\n\n## Test\n\n```sh\ndocker compose up -d\nmake testacc\n```\n\n## Tools to convert logs to JSON Lines\n* MySQL\n    * https://github.com/winebarrel/genlog\n* PostgreSQL\n    * https://github.com/winebarrel/poslog\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinebarrel%2Fqube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwinebarrel%2Fqube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinebarrel%2Fqube/lists"}