pimvdmolen/request-cost-indicator
Composer 安装命令:
composer require pimvdmolen/request-cost-indicator
包简介
A lightweight, always-visible request cost awareness and analysis indicator for Laravel applications (local/staging only).
README 文档
README
A lightweight, always-visible request cost awareness and analysis indicator for Laravel applications.
Designed to make expensive requests impossible to ignore, while allowing you to drill down into why they are expensive when you choose to.
What this package does
On every HTML page load (local/staging only), it shows:
-
A small, fixed indicator at the bottom of the page with:
- Total request time (ms)
- Number of database queries
-
An expandable panel with:
- A visual cost breakdown (Database / HTTP / Views / Other)
- Minimal counters
- A short interpretation sentence
Optionally, you can enable details mode, which captures additional data for the current request:
- Aggregated database query timings (grouped, no SQL output)
- External HTTP call timings
- View render timings
- Source locations (file + line, relative to project root)
The default mode is intentionally lightweight. Details are only collected when you explicitly ask for them.
What this package deliberately does not do (for now)
- ❌ No per-query SQL inspection
- ❌ No raw stack traces by default
- ❌ No JSON / API response support
- ❌ No frontend frameworks or build steps
- ❌ No production usage
These boundaries are intentional and may evolve as the package grows.
Requirements
- PHP 8.3+
- Laravel 12+
Intended for:
local- optionally
staging
Never intended for production environments.
Installation
Install the package as a dev dependency:
composer require pimvdmolen/request-cost-indicator --dev
No service provider registration is required. No assets need to be published.
Refresh a page and the indicator will appear automatically.
Enabling or disabling the indicator
By default, the indicator is enabled when:
APP_DEBUG=true- The application environment is
local
You can control this via your .env file.
Enable
APP_DEBUG=true
Disable (recommended for production)
APP_DEBUG=false
You can also fine-tune this behavior in config/request-cost-indicator.php.
Details mode
By default, the indicator runs in a low-overhead mode.
To enable details for the current request:
- Open the panel
- Click Details
This triggers a page reload and enables deeper measurements for that request.
⚠️ Details mode adds overhead due to additional timing and stack inspection. Turn it off when you’re done.
Themes
The indicator supports:
- Light mode
- Dark mode
Your preference is stored in a cookie and persists across page loads.
Design philosophy
This package is built around a simple idea:
Make request cost visible first, explain it second.
You should notice expensive requests immediately, and only then decide how far you want to drill down.
The goal is to reduce the friction between noticing a performance problem and understanding where it comes from.
License
MIT
Author
Built by Pim van der Molen
https://pimvdmolen.nl
pimvdmolen/request-cost-indicator 适用场景与选型建议
pimvdmolen/request-cost-indicator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 12 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「performance」 「debugging」 「request」 「profiling」 「laravel」 「laravel-package」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 pimvdmolen/request-cost-indicator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pimvdmolen/request-cost-indicator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 pimvdmolen/request-cost-indicator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
g4 application profiler package
CSS/Javascript Minificator, Compressor and Concatenator for TYPO3 - highly configurable frontend asset optimization for CSS/JS merging, minification and compression with optional body parsing, async/defer loading, inline output, data-ignore exclusions, SRI integrity validation/calculation, external
WordPress mu-plugin to remove jQuery Migrate from the list of jQuery dependencies and to allow jQuery to enqueue before </body> instead of in the <head>.
Create link to static resources with cache-breaking segment based on md5 of the file
A PHP package that takes a snapshot of your application and allows you to retrieve it later to help with debugging.
HTTP request logger middleware for Laravel
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 31
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-21