定制 arrayiterator/profiler 二次开发

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

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

arrayiterator/profiler

Composer 安装命令:

composer require arrayiterator/profiler

包简介

Record & profiling the code

README 文档

README

Code Checking

INSTALLATION

composer require arrayiterator/profiler

PROFILING

use ArrayIterator\Profiler\Profiler;

$profiler = new Profiler();
// start the profiler
$performance = $profiler->start('benchmark', 'Group Name', ['data' => 'information']);
try {
    // do something with the code
    // write the code that you want to benchmark
} finally {
    // best practice to stop the profiler using try -> finally
    // using finally to make sure the profiler is stopped
    $performance->stop(['additional' => 'information']);
    // or using profiler object
    // the group name is important when you have different group of benchmark
    // the group: default, as default group
    // the name of benchmark also important to identify the benchmark
    $profiler->stop('benchmark', 'Group Name', ['additional' => 'information']);
}

RENDERING TOOLBAR

/**
 * @var \ArrayIterator\Profiler\Profiler $profiler 
 */
$waterfall = $profiler->getWaterfall();

// render the toolbar
$darkMode = null; // set true if default dark mode or let it null when using autodetect
$content = $waterfall->renderJs($darkMode);

// can be echo or append to stream
// echo $content;
// append to stream interface (PSR-7)
// $response->getBody()->write($content);

PREVIEW

Toolbar Preview Toolbar Preview

ATTENTION

This package still under development, the profiler is ready but the UI is not yet ready. The UI is still under development.

But the profiler is ready to use, you can use it by installing the package and use the profiler. You can customize the implementation of the Frontend or Backend.

UI & IMPLEMENTATION OF RENDERER

Typescript & scss [assets] is used to create the UI, the UI is created using the following technologies:

Maximum record size is 5000 records, if more than 5000 records, the UI will not render the benchmark. (maximum record size can be changed in the preferences). When the record less than 5000 and set less than record, can be reset with:

window.arrayiterator_waterfall.set_max_records(5000);

REQUIREMENT:

  • PHP 7.4 or later
  • Composer
  • DEV (Node.js (npm) - for installing the dependencies)

TASKS

BACKEND

  • Benchmark Profiler
  • Memory Profiler
  • Time Profiler
  • Render Profiler
  • Code Styling & PhpStan

FRONTEND

  • ToolBar (Chrome Like)
  • Dark Mode & Light Mode (Auto Detect)
  • Resizeable
  • Responsiveness
  • Action Size
    • Maximize
    • Minimize (restore)
    • Close
  • Benchmark Tab
    • Filtering
    • Waterfall Profiling
    • Importer
    • Exporter
    • Restorer
    • Message (information about the import, export, restore)
    • Input Search
    • Horizontal Resizable Section
  • Labs Tab (Under Development)
    • Profiler Information
    • Metadata of JSON
    • RAM Usage & Limit (chart using pie chart from highchart.js)
    • Additional Information
    • Chart for benchmark
  • Source Tab

Benchmark Tab

  • Filtering
    • Importer
    • Exporter
    • Restorer
    • Message (information about the import, export, restore)
    • General Filter
    • Performance Filter (Slow, Fast, Average)
    • Search Filter (Follow the benchmark content)
    • Aggregator Filter (Follow the benchmark aggregation)
  • Waterfall Profiling
    • Using waterfall using div percentage
    • Add additional information for certain table
    • Clickable to show the detail of the benchmark

Labs Tab

  • Profiler Information
    • Metadata of JSON
    • RAM Usage & Limit (chart using pie chart from highchart.js)
    • Additional Information
    • Chart for benchmark

Source Tab

  • Code Section
    • Prettify/Minify the source code
    • Download the source code
    • Import the source code

DEPENDENCIES

NOTE

Rendering benchmark & source code using looping og setTimeout to make sure the rendering is not blocking the main thread.

LICENSE

MIT License

arrayiterator/profiler 适用场景与选型建议

arrayiterator/profiler 是一款 基于 TypeScript 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 09 月 26 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「profiler」 「benchmark」 「record」 「php profiler」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 arrayiterator/profiler 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 arrayiterator/profiler 我们能提供哪些服务?
定制开发 / 二次开发

基于 arrayiterator/profiler 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-26