janmikes/slowpoker

dev-master 2020-02-28 16:48 UTC

This package is auto-updated.

Last update: 2024-08-29 02:41:48 UTC


README

运行Apache基准测试以测量应用程序的速度。

要求

  • PHP 7.3及以上
  • Apache Bench
  • Git仓库(用于查找慢提交功能)

安装

  • composer require janmikes/slowpoker

特性

  • 清除缓存
  • 优化composer自动加载器
  • 完成时清理git仓库中的更改

用法

bin/test-speed [options]

Options:
      --maxSpeed=MAXSPEED  Max allowed response time, if not met (is higher) will exit as error
      --requests=REQUESTS  Number of HTTP requests made [default: 2000]
      --url=URL            URL to test speed with (glami.cz will be replaced with your working copy) [default: "http://www.glami.cz/damske-baleriny/?original"]
      --cacheDir=CACHEDIR  Relative path to cache directory [default: "temp/cache"]

与git bisect一起使用

当与git bisect一起使用时,此工具非常出色,可以检测到哪个提交使应用程序变慢。

请注意,您的工作副本必须是有效的git仓库(它必须包含.git目录)。

在您的工作仓库(工作副本)中运行此命令

git bisect start <BAD> <GOOD>
git bisect run <TESTER>

最小示例,当我知道当前提交变慢(80ms)而提交647b912变快(72ms)时,我想找出哪个提交使其变慢 >73ms

git bisect start HEAD 647b912
git bisect run /some-path/bin/speed-test --maxSpeed=73

本包由Glami赞助,谢谢!