承接 myaaghubi/debench 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

myaaghubi/debench

最新稳定版本:1.7

Composer 安装命令:

composer require myaaghubi/debench

包简介

A small debug/benchmark helper for PHP

README 文档

README

Test Debench Debench Coverage Status Debench release (latest by date) Debench License

A small and lightweight debug/benchmark helper for PHP.

myaaghubi/debench-debench-minimal myaaghubi/debench-debench-fullsize

How to use

Use composer:

composer require myaaghubi/debench

Then have it like:

namespace DEBENCH;

require __DIR__ . '/vendor/autoload.php';

// call it from your index.php after autoload 
// then check the webpage with your browser
// $debench = new Debench(true, '../public', $base->get('ASSETS'));
Debench::getInstance(true, '../public', $base->get('ASSETS'));

// for enable() or minimalOnly() you can 
// call them even before getInstance
Debench::enable(false);

// for dump(), info(), warning() and error() you can 
// call them before getInstance too
Debench::info('let\'s use some memory');

// let's load some
$st = str_repeat("Debench!", 10000);
Debench::point('one');
Debench::dump($st);

// let's load some more
$st .= str_repeat("Debench!", 10000);
// $debench->newPoint("two");
Debench::point('two');

For minimal mode:

// it is safe and secure to use
// $debench->setMinimalOnly(true);
Debench::minimalOnly(true);

For production mode

// it's better to do it on initializing
//$debench = new Debench(false);
Debench::getInstance(false);
// or
Debench::enable(false);

For comparison mode

// Debench::compare($func1, $func2, $tag='', $iterations=1000);
Debench::compare(function () use ($mongo) {
    $mongo->find([])
}, function () use ($sql) {
    $sql->exec('select ...');
});

How to test

Just run:

./vendor/bin/phpunit

License

You are allowed to use this plugin under the terms of the MIT License.

Copyright (C) 2025 Mohammad Yaaghubi

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-01