承接 sustartx/laravel-debugbar-memory 相关项目开发

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

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

sustartx/laravel-debugbar-memory

Composer 安装命令:

composer require sustartx/laravel-debugbar-memory

包简介

Add detailed memory usage measurement for code blocks in laravel debugbar

README 文档

README

License

Add detailed memory usage measurement for code blocks in Laravel Debugbar

Note

This package was cloned from Amir Irfan's iffifan/laravel-debugbar-memory repo. I made some improvements by cloning because I saw that he did not contribute to the project for a long time. Thank him for publishing this package.

Installation

composer require sustartx/laravel-debugbar-memory --dev

or add composer.json

    "require-dev": {
        "sustartx/laravel-debugbar-memory": "*"
    },
    "extra": {
        "laravel": {
            "dont-discover": [
                "sustartx/laravel-debugbar-memory"
            ]
        }
    },

AppServiceProvider.php

// Debugbar
if (env('DEBUGBAR_ENABLE', false)){
    // $this->app->register(\Barryvdh\Debugbar\ServiceProvider::class);
    $this->app->register(\SuStartX\MemoryDebugbar\Providers\MemoryDebugbarServiceProvider::class);
    // $this->app->alias('Debugbar', \Barryvdh\Debugbar\Facades\Debugbar::class);
}

Usage

After successful installation you should see Memory tab in your Debugbar

Screenshot

Measuring memory usage of a code block

Let's calculate memory usage of a while loop with helper methods

    start_memory_measure('Some Loop');
    $a = 0;
    $b = 'X';
    while ($a < 10000000) {
        $b .= 'X';
        ++$a;
    }
    stop_memory_measure('Some Loop');

Memory calculation will be updated like this:

Screenshot

Disable

Just add

        'memory_details'  => false, //Display memory details

in config/debugbar.php

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固