定制 fruit/benchkit 二次开发

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

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

fruit/benchkit

最新稳定版本:1.1.5

Composer 安装命令:

composer require fruit/benchkit

包简介

Benchmark helper inspired from Golang

README 文档

README

This package is part of Fruit Framework.

BenchKit is set of tools helping you benchmark your program.

Build Status

Synopsis

See mybench.php in example folder.

How to write benchmarks

A benchmark test must be function or public method. It must receive only one parameter with type-hinting.

Organize your benchmarks

Benchmarks are grouped by their class. So it's suggested to put different group of benchmarks into different files.

Benchmark function are collected into an unnamed group.

Command line helper

bench is command line benchmark runner. It will scan specified directory recursivly, find out all benchmark functions, and run. For example:

bench run example

Thanks to CLIFramework, you can run bench help run to see supported command line arguments.

bench does not support construct arguments, you have to write your own benchmark executor to register benchmarks and run it.

XHProf

You can gather xhprof data when running benchmarks with default command line runner by

  • enable --xhprof option and
  • use Fruit\BenchKit\Formatter\XhprofSummary summary formatter.

Passing constructor arguments to formatter

You can pass a string as constructor argument to formatter with --sa and --pa options.

Generate multiple summary without running benchmarks several times

Use Fruit\BenchKit\Formatter\ChainSummary, and pass constructor argument to specify what formatters you want.

bench run -s 'Fruit\BenchKit\Formatter\ChainSummary' --sa '{"chain":["Fruit\\BenchKit\\Formatter\\HighChartSummary":"{\"type\":\"time\"}", "Fruit\\BenchKit\\Formatter\\XhprofSummary":""]}' -p 'Fruit\BenchKit\Formatter\NullProgressLogger' example > /tmp/chart.html

Beware about shell escaping and php string escaping because builtin formatters accepts argument in JSON format. Use --argdebug when in doubt.

License

Any version of MIT, GPL or LGPL.

统计信息

  • 总下载量: 247
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 7
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-10-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固