cumakurt/deli

GitHub: cumakurt/deli

deli 是一个基于 Python 异步架构构建的高性能、轻量级负载和压力测试引擎,支持 Postman 集合导入、实时指标监控和 CI/CD 集成。

Stars: 5 | Forks: 0

# deli **deli** 是一个高性能、轻量级且现代的负载测试引擎。它专注于速度、低资源消耗和开发者体验。 **语言:** [English](README.md) | [Türkçe](README.tr.md) ## 功能特性 * **高性能:** * **异步 I/O:** 基于 `asyncio` 和 `httpx` 构建的异步架构(支持 HTTP/2)。 * **uvloop:** 速度提升 2–4 倍的事件循环(在 Python 3.12+ 上自动启用)。 * **低开销:** 优化的内存使用(`__slots__`)、字符串缓存和批处理 —— 单核每秒可处理 10,000+ 个请求。 * **零分配路径:** 在热路径上尽量减少对象创建。 * **智能指标:** * **T-Digest:** 内存占用低、高精度的流式百分位计算(P50, P95, P99)。 * **低内存:** 固定大小的环形缓冲区使内存消耗与测试时长无关。 * **实时仪表盘:** 具有低资源占用率的实时终端仪表盘。 * **易于使用:** * **Postman 支持:** 直接运行 Postman Collection v2.1 文件。 * **YAML 配置:** 简单、易读的测试场景定义。 * **单文件报告:** 可共享、支持离线查看的 HTML 报告,带有交互式图表。 * **高级场景:** * **压力测试:** 分阶段测试,自动检测破坏点和瓶颈。 * **SLA 校验:** 为 P95、错误率等设置阈值,并在不达标时自动失败。 * **CI/CD 集成:** 支持 JUnit XML 和 JSON 输出格式。 ## 合法与合规使用 **仅对您有权测试的目标进行测试。** 仅对您拥有的、或获得所有者**明确书面授权**的系统、API 或资源运行负载或压力测试。未经授权的测试可能违反计算机滥用相关法律和服务条款,并可能构成滥用或拒绝服务攻击。 - **责任:** 您需对使用此工具的地点和方式承担全部责任。开发者和贡献者不对滥用、损害或法律后果承担任何责任。 - **合法合规:** 遵守您所在司法管辖区适用的所有法律(刑事、民事、合同)。在对第三方或生产系统进行测试之前,必须获得书面许可。请勿导致未经授权测试的系统不可用或受到损害。 - **警告:** 该工具会产生高请求量。未经授权的使用可能导致法律诉讼、账号被封禁或承担法律责任。请仅用于合法的容量规划、性能验证和授权测试。 - **无担保:** 本软件“按原样”提供,不提供任何担保。参见[许可证](LICENSE)。 ## 环境要求 - Python 3.11+ - Postman Collection v2.1(JSON 导出文件)—— 仅在使用 `-c` 时需要 ## 安装 ``` # 从 project root pip install -e . # 或者使用 requirements pip install -r requirements.txt && pip install -e . # 使用 virtual environment(推荐) python3 -m venv .venv source .venv/bin/activate # Linux/macOS # .venv\Scripts\activate # Windows pip install -e . ``` ## 快速开始 验证安装最快的方法是对一个您有权测试的公共端点进行简短的手动 URL 冒烟测试: ``` deli -m https://httpbin.org/get -o report.html --users 5 --duration 10 --no-live ``` 这会启动 5 个虚拟用户并持续 10 秒钟,向该 URL 发送 GET 请求,并生成 `report.html`。在浏览器中打开报告即可查看 TPS、延迟百分位以及各个端点的统计数据。 ### 1. 使用 Postman Collection 进行负载测试 将您的 API 导出为 Postman Collection v2.1 JSON,然后通过定义了用户数、持续时间和场景的 YAML 配置文件将其交给 `deli` 执行: ``` deli -c path/to/collection.json -f config.yaml -o report.html ``` 每个虚拟用户都会重放集合中的请求(包含文件夹)。使用 `-e` 可以在不编辑文件的情况下覆盖 `{{variables}}`: ``` deli -c collection.json -f config.yaml \ -e base_url=https://staging.example.com \ -e api_key=your-token \ -o report.html ``` 如果您的集合依赖于大量变量,可以在测试时加载 Postman 环境文件: ``` deli -c collection.json -E staging.postman_environment.json -f config.yaml -o report.html ``` CLI 中的 `-e` 值会覆盖环境文件中的值。 ### 2. 不使用 Postman 的负载测试(单一 URL) 当您只需要对单一端点(健康检查、网关、静态路由)进行压力测试时,请使用 `-m`: ``` deli -m https://api.example.com/health -f config.yaml -o report.html ``` 您可以跳过 `-f`,直接在命令行中传递所有参数(默认:10 个用户,60 秒,`constant`): ``` deli -m https://httpbin.org/get -o report.html --users 100 --duration 30 --scenario gradual --ramp-up 10 ``` ### 3. 配置示例 (`config.yaml`) ``` users: 100 # Concurrent virtual users at peak ramp_up_seconds: 10 # Time to reach full user count (gradual scenario) duration_seconds: 60 # How long the test runs after ramp-up scenario: gradual # constant | gradual | spike think_time_ms: 50 # Pause between requests per user (ms); simulates user think time # 可选 SLA — 违规情况将显示在 HTML report verdict 中 sla_p95_ms: 500 sla_p99_ms: 1000 sla_error_rate_pct: 1.0 ``` | 场景 | 行为 | |----------|----------| | `constant` | 所有用户立即启动并运行 `duration_seconds`。 | | `gradual` | 用户在 `ramp_up_seconds` 时间内线性增加,然后在 `duration_seconds` 的剩余时间内保持。 | | `spike` | 维持基准负载,接着增加 `spike_users` 个额外用户持续 `spike_duration_seconds`,然后恢复到基准负载。 | ### 4. 集合验证 (`--smoke-test`) 在进行全面负载运行之前,请验证集合和环境变量是否正确解析: ``` deli -c collection.json -E staging.postman_environment.json --smoke-test -o smoke_report.html ``` 这会执行一次轻量级检查:5 个用户,每人迭代一次。建议在导出更改后或在部署流水线中进行更重负载测试之前使用它。 ### 5. 压力测试模式 压力模式会分阶段增加负载,直到突破 SLA 阈值,然后停止并报告破坏点: ``` deli -s -f stress_config.yaml -c collection.json -o stress_report.html deli -s -f stress_config.yaml -m https://api.example.com/health -o stress_report.html ``` **`stress_config.yaml` 示例:** ``` scenario: linear_overload initial_users: 10 step_users: 10 # Users added each phase step_interval_seconds: 30 # Duration of each phase max_users: 500 # Hard cap on concurrent users sla_p95_ms: 1000 # Stop when P95 exceeds this (ms) sla_p99_ms: 2000 sla_error_rate_pct: 5.0 sla_timeout_rate_pct: 10.0 ``` 压力测试报告会增加 **破坏点** 和 **最大可持续负载** 等 KPI,以及一个逐阶段的表格。 ### 6. 推荐工作流 | 步骤 | 目标 | 示例 | |------|------|---------| | 1. 冒烟测试 | 确认端点有响应 | `deli -c collection.json --smoke-test -o smoke.html` | | 2. 基准测试 | 衡量正常流量 | `deli -f examples/config_load_baseline.yaml -c collection.json -o baseline.html` | | 3. 峰值/浸泡测试 | 测试突发流量和耐久度 | `deli -f examples/config_spike.yaml -c collection.json -o spike.html` | | 4. 压力测试 | 寻找容量极限 | `deli -s -f stress_config.yaml -c collection.json -o stress.html` | 预置的配置文件位于 [examples/](examples/) 中。有关场景表,请参阅 [examples/README.md](examples/README.md)。 ## CLI 参考 | 选项 | 简写 | 描述 | |--------|-------|-------------| | **--collection** | **-c** | Postman Collection v2.1 JSON 的路径(在负载测试中如果未使用 -m 则为必填;在针对 Postman 的压力测试中为必填) | | **--config** | **-f** | YAML 配置文件的路径(在负载测试中可选:可省略并使用 --users, --duration 等;在压力测试中必填) | | **--output** | **-o** | 报告输出路径(文件或目录)。默认:`report.html`(负载)或 `stress_report.html`(压力) | | **--env** | **-e** | 集合环境变量:`KEY=VALUE`。可重复使用。覆盖环境文件。仅与 `-c` 一起使用 | | **--environment** | **-E** | Postman 环境 JSON 文件的路径。与 `-c` 一起使用;`-e` 会覆盖文件中的值 | | **--manual-url** | **-m** | 手动目标 URL:仅针对此 URL 运行(不使用 Postman)。与 `-f` 和 `-o` 一起使用 | | **--stress** | **-s** | 运行压力测试模式。`-f` 必须指向压力测试配置;目标通过 `-c` 或 `-m` 指定 | | **--smoke-test** | | 运行 5 个用户、单次迭代的验证测试(集合/环境的完整性检查) | | **--no-live** | | 禁用实时 Rich 面板(无头模式;适用于 CI/Docker) | | **--junit** | | 同时将 JUnit XML 报告写入 PATH(CI:Jenkins, GitLab 等) | | **--json** | | 同时将 JSON 报告写入 PATH(机器可读的指标) | | **--version** | **-v** | 显示版本号并退出 | **配置覆盖**(提供时,覆盖 -f YAML 中的值): | 选项 | 描述 | |--------|-------------| | **--users** | 虚拟用户数 | | **--duration** | 测试持续时间(秒) | | **--ramp-up** | 上升时间(秒) | | **--scenario** | `constant`、`gradual` 或 `spike` | | **--think-time** | 请求之间的延迟(毫秒) | | **--iterations** | 每个用户的循环次数(0 = 按持续时间) | | **--spike-users**、**--spike-duration** | 峰值场景的额外用户数和持续时间 | | **--sla-p95**、**--sla-p99**、**--sla-error-rate** | SLA 阈值 | ## 使用示例 以下部分完整介绍了常见任务:每个命令的作用、何时使用以及在报告中会看到什么内容。 ### 1. Postman 集合负载测试 **何时使用:** 您的 API 流程已在 Postman 中定义完毕,并且您希望对集合中的所有请求进行可重复的负载测试。 **基本运行** —— 配置文件定义了用户数、持续时间和场景;默认在当前目录下输出 `report.html`: ``` deli -c path/to/collection.json -f config.yaml ``` **指定报告路径:** ``` deli -c path/to/collection.json -f config.yaml -o report.html ``` **报告目录** —— 如果 `-o` 指向一个文件夹,`deli` 会在其中创建 `report.html`(适用于按日期归档的测试): ``` deli -c path/to/collection.json -f config.yaml -o ./reports/2026-06-17/ ``` **包含空格的路径** —— 请加上引号包裹集合路径: ``` deli -c "/home/user/Downloads/My API.postman_collection.json" -f config.yaml -o report.html ``` **内置示例** —— 无需准备自己的集合,直接尝试仓库中的示例: ``` deli -c examples/sample_collection.json -f examples/config_smoke.yaml -o report_smoke.html --no-live ``` **在报告中需要检查的内容:** 测试结论(如果设置了 SLA 则为通过/失败)、随时间变化的 TPS、P95/P99 延迟、端点表格(最慢的路由排在最前)以及 SLA 违规列表。 ### 2. 环境变量 (`-e`) 与环境文件 (`-E`) **何时使用:** 集合使用了 `{{base_url}}`、`{{api_key}}` 或其他 Postman 变量,并且您需要在不修改 JSON 的情况下针对不同目标进行测试。 **覆盖单个变量:** ``` deli -c collection.json -f config.yaml -e base_url=https://api.example.com -o report.html ``` **覆盖多个变量** —— 重复使用 `-e`;后面的值不会覆盖前面已有的键: ``` deli -c collection.json -f config.yaml \ -e base_url=https://staging.example.com \ -e api_key=secret123 \ -e timeout=5000 \ -o report.html ``` **Postman 环境文件** —— 从导出的环境中加载所有变量,然后使用 `-e` 覆盖特定的键: ``` deli -c collection.json \ -E staging.postman_environment.json \ -e base_url=https://hotfix.example.com \ -f config.yaml \ -o report.html ``` **注意:** 通过 `-e` 传递的密钥可能会出现在进程列表中;在生产流水线中,建议使用权限受限的环境文件。 ### 3. 集合冒烟测试 (`--smoke-test`) **何时使用:** 在导出集合后、更改环境变量时,或者在长时间的浸泡测试之前 —— 确认每个请求都能正常解析和返回,而无需运行全部负载。 ``` deli -c collection.json -E staging.postman_environment.json --smoke-test -o smoke_report.html ``` 运行 5 个虚拟用户,每人迭代一次。失败信息会迅速显示在终端和 `smoke_report.html` 中。可以结合 CI 使用: ``` deli -c collection.json --smoke-test -o smoke_report.html --junit ci/smoke.xml --no-live ``` ### 4. 通过 CLI 覆盖配置 **何时使用:** 您有一个共享的 YAML 配置文件,但需要调整某次运行(如增加用户数、延长持续时间、更改场景)而不想复制文件。 CLI 参数会覆盖 `-f` YAML 中对应的键。例如 —— 在单次预发布测试中将用户数增加到 80: ``` deli -m https://api.example.com/health -f config.yaml -o report.html --users 80 --no-live ``` **将持续时间延长至 2 分钟:** ``` deli -c collection.json -f config.yaml -o report.html --duration 120 --no-live ``` **切换为渐进式上升:** ``` deli -m https://httpbin.org/get -f config.yaml -o report.html --scenario gradual --ramp-up 30 --no-live ``` **无配置文件** —— 所有参数均在命令行中指定(默认:10 个用户,60 秒,`constant`): ``` deli -m https://httpbin.org/get -o report.html --users 5 --duration 10 --no-live deli -c collection.json -o report.html --users 20 --duration 30 --scenario gradual --ramp-up 15 --no-live ``` **通过 CLI 设置 SLA** —— 无需修改 YAML 即可强制执行阈值: ``` deli -c collection.json -f config.yaml -o report.html \ --sla-p95 400 --sla-p99 800 --sla-error-rate 0.5 ``` ### 5. 无头模式 (`--no-live`) **何时使用:** CI 运行器、Docker、cron 作业或任何没有 TTY 的环境。禁用实时 Rich 仪表盘;指标每秒输出一次到 stdout。 ``` deli -c collection.json -f config.yaml -o report.html --no-live ``` 典型的 CI 步骤: ``` deli -c collection.json -f examples/config_smoke.yaml \ -o report.html \ --junit test-results/deli.xml \ --json test-results/deli.json \ --no-live ``` JUnit 会将 SLA 违规标记为失败的测试;JSON 可用于对接仪表盘或自定义门禁。 ### 6. 负载场景 每种场景回答了不同的性能问题。请为每个场景保存单独的 YAML 文件,以便于重现测试。 #### 恒定负载 **问题:** 系统在稳定、固定的并发下表现? ``` # config_constant.yaml users: 20 ramp_up_seconds: 5 duration_seconds: 120 iterations: 0 think_time_ms: 100 scenario: constant ``` ``` deli -c collection.json -f config_constant.yaml -o report_constant.html ``` #### 渐进式上升 **问题:** 系统能否在不出现启动延迟峰值的情况下平滑吸收流量增长? ``` # config_gradual.yaml users: 50 ramp_up_seconds: 60 duration_seconds: 180 iterations: 0 think_time_ms: 50 scenario: gradual ``` ``` deli -c collection.json -f config_gradual.yaml -o report_gradual.html ``` #### 突发流量 **问题:** 在突然的流量激增(闪购、病毒式传播事件)期间会发生什么,系统能否恢复? ``` # config_spike.yaml users: 10 ramp_up_seconds: 20 duration_seconds: 120 think_time_ms: 100 scenario: spike spike_users: 40 spike_duration_seconds: 15 ``` ``` deli -c collection.json -f config_spike.yaml -o report_spike.html ``` 在突发流量窗口期间,实际并发数为 `users + spike_users`(在此示例中为 50)。 #### SLA 验证 **问题:** 本次运行是否满足了我们的 SLO?违规情况将在报告结论中列出。 ``` # config_with_sla.yaml users: 30 ramp_up_seconds: 10 duration_seconds: 60 think_time_ms: 100 scenario: constant sla_p95_ms: 500 sla_p99_ms: 1000 sla_error_rate_pct: 1.0 ``` ``` deli -c collection.json -f config_with_sla.yaml -o report_sla.html ``` #### `examples/` 中的预置配置 | 文件 | 用途 | |------|---------| | `config_smoke.yaml` | 极小负载;部署后的完整性检查 | | `config_load_baseline.yaml` | 正常的预期流量;回归测试基准 | | `config_load_stress.yaml` | 逼近容量极限的高强度恒定负载 | | `config_spike.yaml` | 突发的流量激增 | | `config_soak.yaml` | 长时间的耐久运行;检测内存泄漏和性能下降 | | `config_ramp_gradual.yaml` | 从 0 平滑增加至目标用户数 | ``` deli -f examples/config_load_baseline.yaml -c examples/sample_collection.json -o report_baseline.html --no-live ``` ### 7. 手动 URL 模式 (`-m`) **何时使用:** 需要在不维护 Postman 集合的情况下,快速进行健康检查或单端点吞吐量测试。 ``` deli -m https://api.example.com/health -f config.yaml -o report.html ``` **同一主机上的不同路径:** ``` deli -m https://api.example.com/v1/users -f config.yaml -o report_manual.html ``` **无头模式下的单 URL 基准测试:** ``` deli -m https://httpbin.org/get -f config.yaml -o report.html --no-live ``` 使用 `-m` 时,会忽略 `-c` 和 `-e`;只会对指定的 URL 进行测试。 ### 8. 压力测试 (`-s`) **何时使用:** 您需要了解最大可持续负载,或者延迟或错误超过 SLO 的确切临界点。压力测试模式独立于负载测试:具有不同的配置 schema、分阶段增压、并在突破阈值时自动停止。 **Postman 目标:** ``` deli -s -f stress_config.yaml -c collection.json -o stress_report.html ``` **手动 URL 目标:** ``` deli -s -f stress_config.yaml -m https://api.example.com/health -o stress_report.html ``` **输出目录:** ``` deli -s -f stress_config.yaml -c collection.json -o ./stress_results/ ``` **无头模式压力测试:** ``` deli -s -f stress_config.yaml -c collection.json -o stress_report.html --no-live ``` ### 9. 压力测试场景 #### 线性超载 用户逐步增加,直到 SLA 被打破或达到 `max_users`。用于识别 P95 或错误率发生降级的负载级别。 ``` # stress_linear.yaml sla_p95_ms: 500 sla_p99_ms: 1000 sla_error_rate_pct: 1.0 sla_timeout_rate_pct: 5.0 initial_users: 5 step_users: 5 step_interval_seconds: 30 max_users: 200 think_time_ms: 0 scenario: linear_overload ``` ``` deli -s -f stress_linear.yaml -c collection.json -o stress_linear.html ``` #### 突发压力 在 `spike_hold_seconds` 时间内施加高并发突发流量,以测试系统的突发处理能力。 ``` # stress_spike.yaml sla_p95_ms: 500 sla_p99_ms: 1000 sla_error_rate_pct: 1.0 initial_users: 5 step_users: 5 step_interval_seconds: 30 max_users: 100 scenario: spike_stress spike_users: 80 spike_hold_seconds: 45 ``` ``` deli -s -f stress_spike.yaml -c collection.json -o stress_spike.html ``` #### 浸泡后增压 先运行持续的低负载(`soak_users` 持续 `soak_duration_seconds`),然后再增压 —— 有助于在过载前捕获内存泄漏。 ``` # stress_soak.yaml sla_p95_ms: 500 sla_p99_ms: 1000 sla_error_rate_pct: 1.0 initial_users: 10 step_users: 10 step_interval_seconds: 30 max_users: 150 scenario: soak_stress soak_users: 20 soak_duration_seconds: 120 ``` ``` deli -s -f stress_soak.yaml -c collection.json -o stress_soak.html ``` ### 10. Docker **构建镜像:** ``` docker build -t deli . ``` 容器以非 root 用户运行。挂载主机目录,并在容器内传递**绝对**输出路径。使用 `--user $(id -u):$(id -g)` 以确保报告文件在主机上可写。 **快速手动 URL 运行 —— 报告在当前目录生成:** ``` docker run --rm --user $(id -u):$(id -g) -v $(pwd):/data deli \ -m https://httpbin.org/get \ -f /app/examples/config.yaml \ -o /data/report.html \ --no-live ``` **使用您自己的集合和配置:** ``` docker run --rm --user $(id -u):$(id -g) -v $(pwd):/data -v $(pwd)/reports:/tmp deli \ -c /data/collection.json \ -f /data/config.yaml \ -o /tmp/report.html \ --no-live # => 位于主机上的 reports/report.html ``` **使用内置示例配置进行压力测试:** ``` docker run --rm --user $(id -u):$(id -g) -v $(pwd)/reports:/tmp deli \ -s -m https://httpbin.org/get \ -f /app/examples/stress_config.yaml \ -o /tmp/stress_report.html \ --no-live ``` **在 Docker 中通过 CLI 覆盖配置:** ``` docker run --rm --user $(id -u):$(id -g) -v $(pwd):/data deli \ -m https://httpbin.org/get \ -f /app/examples/config.yaml \ -o /data/report.html \ --users 50 --duration 20 --scenario gradual --ramp-up 10 \ --no-live ``` ### 11. 完整负载配置参考示例 ``` # config.yaml — load test users: 25 ramp_up_seconds: 15 duration_seconds: 300 iterations: 0 # 0 = run for duration; >0 = N loops per user then stop think_time_ms: 200 scenario: gradual # Spike keys(仅当 scenario: spike 时适用) spike_users: 50 spike_duration_seconds: 20 # SLA(可选 — 违规情况将在 report 中列出) sla_p95_ms: 400 sla_p99_ms: 800 sla_error_rate_pct: 0.5 ``` ### 12. 完整压力配置参考示例 ``` # stress_config.yaml — 与 -s 配合使用 sla_p95_ms: 500 sla_p99_ms: 1000 sla_error_rate_pct: 1.0 sla_timeout_rate_pct: 5.0 initial_users: 5 step_users: 5 step_interval_seconds: 30 max_users: 200 think_time_ms: 0 scenario: linear_overload # 用于 spike_stress spike_users: 60 spike_hold_seconds: 30 # 用于 soak_stress soak_users: 15 soak_duration_seconds: 90 ``` 有关完整的场景目录和可直接复制的命令,请参阅 [examples/README.md](examples/README.md)。 ## 配置参考 ### 负载测试配置(不使用 -s) | 键 | 描述 | 默认值 | |-----|-------------|---------| | users | 虚拟用户数 | 10 | | ramp_up_seconds | 上升时间(gradual 场景) | 10 | | duration_seconds | 测试持续时间(秒) | 60 | | iterations | 0 = 按持续时间;>0 = 每个用户循环 N 次 | 0 | | think_time_ms | 请求之间的延迟(毫秒) | 0 | | scenario | constant \| gradual \| spike | constant | | spike_users | 突发期间的额外用户数 | 0 | | spike_duration_seconds | 突发阶段持续时间 | 0 | | sla_p95_ms | SLA P95(毫秒);报告违规情况 | - | | sla_p99_ms | SLA P99(毫秒) | - | | sla_error_rate_pct | 最大错误率 % | - | ### 压力测试配置(使用 -s) | 键 | 描述 | 示例 | |-----|-------------|---------| | sla_p95_ms | P95 阈值(毫秒);超出时停止 | 500 | | sla_p99_ms | P99 阈值(毫秒) | 1000 | | sla_error_rate_pct | 最大错误率 %;超出时停止 | 1.0 | | sla_timeout_rate_pct | 最大超时率 % | 5.0 | | initial_users | 初始并发用户数 | 5 | | step_users | 每个阶段增加的用户数 | 5 | | step_interval_seconds | 每个阶段持续时间(秒) | 30 | | max_users | 最大用户限制 | 200 | | scenario | linear_overload \| spike_stress \| soak_stress | linear_overload | | spike_users, spike_hold_seconds | 突发阶段 (spike_stress) | 50, 30 | | soak_users, soak_duration_seconds | 浸泡阶段 (soak_stress) | 10, 60 | ## 报告 **负载测试报告:** 单文件 HTML,完全离线(无 CDN)。包含摘要、场景摘要、KPI 卡片(总请求数、TPS、P95/P99、成功/错误率)、测试结论、性能图表(随时间变化的 TPS、延迟、错误率)、响应时间分布、SLA 违规情况、端点表格和原始数据(超过 1 万个请求时自动分页)。图表使用内嵌的 ECharts。 **压力测试报告:** 布局相同;增加了破坏点和最大可持续负载 KPI、系统行为摘要、负载与 P95/P99 及错误率的对比曲线、以及各阶段结果表格。 **JUnit 和 JSON:** 使用 `--junit path.xml` 和/或 `--json path.json` 生成对 CI 友好的 JUnit XML(SLA 违规 = 失败的测试)和机器可读的 JSON 指标。 **日志:** 可通过 `DELI_LOG_LEVEL`(例如 `DEBUG`、`INFO`)和可选的 `DELI_LOG_FORMAT=json` 进行配置。 ## 性能说明 `deli` 包含积极的性能优化。详情请参阅 [PERFORMANCE.md](PERFORMANCE.md)。 主要优化点: - **禁用 GC:** 测试期间禁用垃圾回收器(减少延迟峰值)。 - **批处理:** 从队列中批量消费和处理结果。 - **延迟指标计算:** 直方图数据仅在生成报告时计算。 ## 开发 ``` # 运行 linter ruff check . # 运行 tests pytest tests/ ``` ## 开发者 - **邮箱:** [cumakurt@gmail.com](mailto:cumakurt@gmail.com) - **LinkedIn:** [cuma-kurt-34414917](https://www.linkedin.com/in/cuma-kurt-34414917/) - **GitHub:** [cumakurt](https://github.com/cumakurt) ## 许可证 GNU General Public License v3.0 或更高版本 (GPL-3.0-or-later)。完整文本请参见 [LICENSE](LICENSE)。
标签:ASM汇编, LNA, Python, 压力测试, 开发运维, 异步IO, 性能测试, 无后门, 计算机取证, 负载测试, 运行时操纵, 逆向工具