{"id":20733299,"url":"https://github.com/quillstack/benchmark","last_synced_at":"2025-12-25T01:13:36.139Z","repository":{"id":62532195,"uuid":"291494182","full_name":"quillstack/benchmark","owner":"quillstack","description":"Bash/PHP script to benchmark HTTP requests and command-line scripts","archived":false,"fork":false,"pushed_at":"2021-07-09T11:02:32.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T10:45:37.219Z","etag":null,"topics":["bash","benchmark","curl","http","php","requests","script"],"latest_commit_sha":null,"homepage":"https://quillstack.com/benchmark","language":"PHP","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/quillstack.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}},"created_at":"2020-08-30T15:11:00.000Z","updated_at":"2023-07-06T08:53:30.000Z","dependencies_parsed_at":"2022-11-02T15:00:19.894Z","dependency_job_id":null,"html_url":"https://github.com/quillstack/benchmark","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/quillstack/benchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quillstack%2Fbenchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quillstack%2Fbenchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quillstack%2Fbenchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quillstack%2Fbenchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quillstack","download_url":"https://codeload.github.com/quillstack/benchmark/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quillstack%2Fbenchmark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28015133,"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-12-24T02:00:07.193Z","response_time":83,"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":["bash","benchmark","curl","http","php","requests","script"],"created_at":"2024-11-17T05:24:40.747Z","updated_at":"2025-12-25T01:13:36.117Z","avatar_url":"https://github.com/quillstack.png","language":"PHP","readme":"# Benchmark HTTP requests and command line calls\n\n[![StyleCI](https://github.styleci.io/repos/291494182/shield?branch=master)](https://github.styleci.io/repos/291494182?branch=master)\n[![Build Status](https://travis-ci.org/quillstack/benchmark.svg?branch=master)](https://travis-ci.org/quillstack/benchmark)\n[![CodeFactor](https://www.codefactor.io/repository/github/quillstack/benchmark/badge)](https://www.codefactor.io/repository/github/quillstack/benchmark)\n[![Downloads](https://img.shields.io/packagist/dt/quillstack/benchmark.svg)](https://packagist.org/packages/quillstack/benchmark)\n![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/quillstack/di)\n![Packagist License](https://img.shields.io/packagist/l/quillstack/di)\n\nThis repository contains a script to test HTTP GET requests or command line calls.\n\n## PHP usage\n\nYou can install this package using _Composer_:\n\n```\ncomposer require --dev quillstack/benchmark\n```\n\nIn PHP console you can use this library by running commands:\n\n##### List available commands\n\nIf you installed this library as a package in your project, you\ncan run these commands:\n\n###### List of available commands\n\n```\n./vendor/bin/benchmark\n```\n\n###### HTTP GET requests\n\n```\n./vendor/bin/benchmark benchmark:http:get https://example.org 10 2\n```\n\n###### Command line calls\n\n```\n./vendor/bin/benchmark benchmark:console \"php ../test.php\" 10 2\n```\n\n#### Cloned reposotiry\n\nIf you cloned this repository to your local computer, use\nthese commands:\n\n```\n./bin/local\n./bin/local benchmark:http:get https://example.org 10 2\n./bin/local benchmark:console \"php ../test.php\" 10 2\n```\n\n\nTo see detailed descriptions for every command, ready Bash usage below.\n\n## Bash usage\n\nYou can also use Bash commands to run benchmarks. These commands\nwork only if you clone this repository to your computer or server.\n\n###### HTTP GET requests\n\nUsage:\n\n```\n./http_get.sh https://example.org 10 2\n```\n\nWhere:\n- 10 is a total number of requests\n- 2 is a number of concurrent requests\n\nOutput:\n\n```\n10 requests, 2 concurrently\nURL https://example.org\n--------------------------------------------------------------------\nTook 2.468000 s, 4.051864 requests per second, 0.469415 avg req time\n```\n\nWhat means we sent 10 GET requests to this host. We decided to send two\nrequests at the time. The entire test took around 2.5 seconds. It means\nthe website could server 4 requests per second with 0.5 seconds the average\nresponse time.\n\n###### Command line calls\n\nIf you want to test command line calls, be sure every call respond with\nan execution time (in seconds):\n\n```\n0.001699\n``` \n\nFor PHP the script could look like:\n\n```php\n\u003c?php\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\n$start = microtime(true);\n\n$container = new Container();\n$service = $container-\u003eget(ExampleService::class);\n\n$time = microtime(true) - $start;\n$roundedTime = round($time, 6);\n\necho $roundedTime . PHP_EOL;\n```\n\nUsage example:\n\n```\n./command_line.sh \"php ../test.php\" 10 2\n```\n\nOutput:\n\n```\n10 calls, 2 concurrently\nCommand `php ../test.php`\n-------------------------------------------------------------------\nTook 0.247000 s, 40.485830 calls per second, 0.001087 avg call time\n```\n\nThe results say we called the script 10 times with 2 concurrently calls.\nOur test took around 250 milliseconds, what means we could call this\nscript 40 times per seconds, and average call time would be 1 millisecond.\n\n#### Different results\n\nYou can have different results for different parameters. For example the\nresults for the same script:\n\n```\n./command_line.sh \"php ../test.php\" 1000 100\n```\n\nare different for these parameters:\n\n```\n1000 calls, 100 concurrently\nCommand `php ../test.php`\n-------------------------------------------------------------------\nTook 7.760000 s, 128.865979 calls per second, 0.080927 avg call time\n```\n\nBecause we increased the number of concurrent calls.\n\nIf we use the same concurrent calls like in the first command line example:\n\n```\n./command_line.sh \"php ../test.php\" 1000 2\n```\n\nThe results should be similar to the first ones:\n\n```\n1000 calls, 2 concurrently\nCommand `php ../di/public/index.php`\n-------------------------------------------------------------------\nTook 22.795000 s, 43.869270 calls per second, 0.001178 avg call time\n```\n\nWhat gives use around 40 calls per second, if we have two concurrent\ncalls.\n\n## Quill Stack\n\nIf you want to know more about other solutions, visit the website: \\\nhttps://quillstack.com/ \n\n![The Quill Stack](http://quillstack.com/quillstack.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquillstack%2Fbenchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquillstack%2Fbenchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquillstack%2Fbenchmark/lists"}