atrapalo/phpunit-memory-and-time-usage-listener 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

atrapalo/phpunit-memory-and-time-usage-listener

Composer 安装命令:

composer require atrapalo/phpunit-memory-and-time-usage-listener

包简介

PHPUnit Listener for measure time and memory usage

README 文档

README

This PHPUnit listener provides information about each test time, memory and memory peak usage, with two versions configured by parameters:

  • One in which at the end of the test suits shows the information for all the executed test.
  • One in which you indicates the edge for all the measurements and it only shows the results if one ot them exceed it's edge.

If no parameter is defined on the phpunit.xml the default behaviour is to show all the results.

The arguments you can define on the phpunit.xml file are:

  • showOnlyIfEdgeIsExceeded (boolean): The default value is false, if you set it to true is recommended to set the other three optional arguments.
  • executionTimeEdge (int)(milliseconds): Only needed if showOnlyIfEdgeIsExceeded is set to true. The default value is 100 and indicates the limit of usage time for every test
  • memoryUsageEdge (int)(bytes): Only needed if showOnlyIfEdgeIsExceeded is set to true. The default value is 1024 and indicates indicate the limit of memory usage for every usage
  • memoryPeakDifferenceEdge (int)(bytes): Only needed if showOnlyIfEdgeIsExceeded is set to true. The default value is 1024 and indicates the maximum difference between memory peak.

Installation:

The installation for use this listener it's as easy as require it with composer as any other. I recommend to indicate the requirement only for dev.

require-dev{
    "atrapalo/phpunit-memory-and-time-usage-listener": "dev-master"
}

Usage examples:

XML example for listener usage without edges:

    <listener class="\PhpunitMemoryAndTimeUsageListener\Listener\Measurement\TimeAndMemoryTestListener"/>

XML example for listener usage with edges:

     <listeners>
         <listener class="\PhpunitMemoryAndTimeUsageListener\Listener\Measurement\TimeAndMemoryTestListener">
             <arguments>
                 <array>
                     <element key="showOnlyIfEdgeIsExceeded">
                         <boolean>true</boolean>
                     </element>
                     <element key="executionTimeEdge">
                         <integer>100</integer>
                     </element>
                     <element key="memoryUsageEdge">
                         <integer>1024</integer>
                     </element>
                     <element key="memoryPeakDifferenceEdge">
                         <integer>10240</integer>
                     </element>
                 </array>
             </arguments>
         </listener>
     </listeners>

统计信息

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

GitHub 信息

  • Stars: 17
  • Watchers: 118
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-04-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固