You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Collecting code coverage information has a significant impact on performance, no matter whether you use PCOV or Xdebug directly (without this library) or using this library.
I reference pcov to statistics coverage, the original only 600ms interface, now increased to 8s to return
/**
*/
function __coverage_stop(CodeCoverage $coverage)
{
$coverage->stop();
$writer = new \SebastianBergmann\CodeCoverage\Report\PHP();
// 设置生成代码覆盖率页面的路径
$file_name = substr(md5(uniqid()), 0, 5);
#获取请求接口的url
$file_name = $url .''. $file_name;
$writer->process($coverage, dirname(FILE) . '/tmp/coverage/'. $file_name .'.cov');
}
$filter = new \SebastianBergmann\CodeCoverage\Filter();
$driver = new \SebastianBergmann\CodeCoverage\Driver\PcovDriver($filter);
$coverage = new CodeCoverage($driver, $filter);
$id=substr(md5(uniqid()), 0, 15);
$coverage->start($id,null,true); //开始统计
register_shutdown_function('__coverage_stop', $coverage); //注册函数关闭时的回调函数
The text was updated successfully, but these errors were encountered: