{"id":28747884,"url":"https://github.com/stekel/laravel-bench","last_synced_at":"2025-06-16T17:12:12.620Z","repository":{"id":57059535,"uuid":"143054759","full_name":"stekel/laravel-bench","owner":"stekel","description":"Php wrapper for Apache-Bench with Laravel integration","archived":false,"fork":false,"pushed_at":"2021-12-08T21:50:14.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-16T09:49:18.037Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/stekel.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":"2018-07-31T18:53:14.000Z","updated_at":"2021-12-08T21:50:06.000Z","dependencies_parsed_at":"2022-08-24T07:30:35.316Z","dependency_job_id":null,"html_url":"https://github.com/stekel/laravel-bench","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/stekel/laravel-bench","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stekel%2Flaravel-bench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stekel%2Flaravel-bench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stekel%2Flaravel-bench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stekel%2Flaravel-bench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stekel","download_url":"https://codeload.github.com/stekel/laravel-bench/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stekel%2Flaravel-bench/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260203959,"owners_count":22974100,"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":[],"created_at":"2025-06-16T17:12:11.450Z","updated_at":"2025-06-16T17:12:12.614Z","avatar_url":"https://github.com/stekel.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel-Bench\n\nPhp wrapper for Apache-Bench with Laravel integration\n\n----\n\n## Requirements\n\n- PHP \u003e= 7.0\n- ApacheBench `$ ab`\n\n## Installation\n\n### Laravel\n\nRequire it with Composer:\n```bash\ncomposer require stekel/laravel-bench --dev\n```\n\nPublish the package configuration file\n```bash\nartisan vendor:publish --provider=stekel\\LaravelBench\\Laravel\\Providers\\LaravelBenchServiceProvider\n```\n\n## Usage\n\nRun the following command from the root of a Laravel application\n\n```bash\nphp artisan stekel:bench {test}\n```\n\nThe following tests are available:\n\n- homepage - Sends 100 requests to `/`\n\n## Custom Tests\n\nCreate a new test somewhere in your repository and add the c\n\nThe following test will execute 100 requests (10 at a time) against the homepage ('/') \n\n```php\n\u003c?php // App\\Benchmarks\\Homepage.php\n\nnamespace stekel\\LaravelBench\\Assessments;\n\nuse stekel\\LaravelBench\\Assessment;\n\nclass Homepage extends Assessment\n{\n    /**\n     * Path to execute the test against\n     *      - If null, create route via slug for execution\n     */\n    public ?string $path = '/';\n\n    /**\n     * Number of requests to send at a time\n     */\n    public int $concurrency = 10;\n\n    /**\n     * Number of total requests to send\n     */\n    public int $requests = 100;\n\n    /**\n     * Slug to use for reference\n     */\n    public string $slug = 'homepage';\n}\n```\n\nThe following test will execute 100 requests (10 at a time) against a custom route ('/performance/large-query') which is generated by the test. The given route is only active for the environments listed in the configuration file and will execute any code within the `route()` function.\n\n```php\n\u003c?php\n// App\\Benchmarks\\LargeQuery.php\n\nnamespace App\\Benchmarks;\n\nuse stekel\\LaravelBench\\Assessment;\n\nclass LargeQuery extends Assessment\n{\n    public $path = null;\n    public $concurrency = 10;\n    public $requests = 100;\n    public $slug = 'large-query';\n    \n    public function route() {\n        User::limit(1000)-\u003eget();\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstekel%2Flaravel-bench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstekel%2Flaravel-bench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstekel%2Flaravel-bench/lists"}