定制 laramint/laravel-stress 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

laramint/laravel-stress

最新稳定版本:v1.0.2

Composer 安装命令:

composer require laramint/laravel-stress

包简介

Fire-and-forget HTTP stress testing runner for Laravel development environments

README 文档

README

Fire-and-forget HTTP stress testing engine for Laravel development.

Spawns Guzzle request pools in a background subprocess so they never deadlock against PHP's single-threaded built-in server (php artisan serve). Works transparently with multi-threaded servers (Nginx, Apache, Herd, Valet) via an in-process fallback.

Installation

composer require laramint/laravel-stress

Usage

use LaraMint\LaravelStress\StressTestRunner;

$runner = new StressTestRunner;

// Background (non-blocking) — returns a job ID to poll
$jobId = $runner->startBackground([
    'method'      => 'GET',
    'url'         => 'http://127.0.0.1:8000/api/users',
    'count'       => 50,
    'concurrency' => 5,
    'timeout'     => 10,
    'headers'     => ['Authorization' => 'Bearer token'],
    'body'        => null,
]);

// Poll the result file written by the subprocess
$resultFile = sys_get_temp_dir() . '/lb_st_res_' . $jobId . '.json';
// { "status": "running" }  →  keep polling
// { "status": "done", "result": { ... } }  →  done

// Synchronous (blocking) — works with multi-threaded servers
$result = $runner->run([...]);

Result shape

{
  "total": 50,
  "succeeded": 48,
  "failed": 2,
  "successRate": 96.0,
  "errorRate": 4.0,
  "throughput": 12.5,
  "timing": { "min": 42.1, "avg": 95.3, "p50": 88.0, "p95": 210.4, "p99": 380.1, "max": 420.7 },
  "statusDistribution": { "200": 48, "500": 2 },
  "errors": [],
  "wallTimeMs": 4000
}

License

MIT

统计信息

  • 总下载量: 10.3k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 8
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固