steevanb/doctrine-stats
Composer 安装命令:
composer require steevanb/doctrine-stats
包简介
Count managed and lazy loaded entities, hydration time etc
README 文档
README
doctrine-stats
Add important Doctrine statistics:
- Count managed entities
- Count lazy loaded entities
- Hydration time by hydrator and query
- Group queries by query string, show differents parameters used by same query string
- Count different query string used
Installation
composer require --dev steevanb/doctrine-stats ^2.0
If you want to add hydration time to your statistics:
composer.json
{
"autoload": {
"psr-4": {
"ComposerOverloadClass\\": "var/cache/ComposerOverloadClass"
}
},
"scripts": {
"pre-autoload-dump": "steevanb\\ComposerOverloadClass\\OverloadClass::overload"
},
"extra": {
"composer-overload-cache-dir": "var/cache",
"composer-overload-class-dev": {
"Doctrine\\ORM\\Internal\\Hydration\\ArrayHydrator": {
"original-file": "vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php",
"overload-file": "vendor/steevanb/doctrine-stats/src/Bridge/ComposerOverloadClass/Doctrine/ORM/Internal/ArrayHydrator.php"
},
"Doctrine\\ORM\\Internal\\Hydration\\ObjectHydrator": {
"original-file": "vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php",
"overload-file": "vendor/steevanb/doctrine-stats/src/Bridge/ComposerOverloadClass/Doctrine/ORM/Internal/ObjectHydrator.php"
},
"Doctrine\\ORM\\Internal\\Hydration\\ScalarHydrator": {
"original-file": "vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php",
"overload-file": "vendor/steevanb/doctrine-stats/src/Bridge/ComposerOverloadClass/Doctrine/ORM/Internal/ScalarHydrator.php"
},
"Doctrine\\ORM\\Internal\\Hydration\\SimpleObjectHydrator": {
"original-file": "vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php",
"overload-file": "vendor/steevanb/doctrine-stats/src/Bridge/ComposerOverloadClass/Doctrine/ORM/Internal/SimpleObjectHydrator.php"
},
"Doctrine\\ORM\\Internal\\Hydration\\SingleScalarHydrator": {
"original-file": "vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php",
"overload-file": "vendor/steevanb/doctrine-stats/src/Bridge/ComposerOverloadClass/Doctrine/ORM/Internal/SingleScalarHydrator.php"
}
}
}
}
composer dumpautoload
Symfony 2.x, 3.x and 4.x integration
Read Installation paragraph before.
# app/AppKernel.php class AppKernel { public function registerBundles() { if ($this->getEnvironment() === 'dev') { $bundles[] = new \Steevanb\DoctrineStats\Bridge\DoctrineStatsBundle\DoctrineStatsBundle(); } } }
If you want to add lazy loaded entities to your statistics:
# app/config/config_dev.yml parameters: doctrine.orm.entity_manager.class: Steevanb\DoctrineStats\Doctrine\ORM\EntityManager
Manual integration
To retrieve statistics, you need to register Steevanb\DoctrineStats\EventSubscriber\DoctrineEventSubscriber in your event manager.
If you want to add lazy loaded entities to your statistics, you need to overload default EntityManager, with Steevanb\DoctrineStats\Doctrine\ORM\EntityManager.
Screenshots
steevanb/doctrine-stats 适用场景与选型建议
steevanb/doctrine-stats 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 85.47k 次下载、GitHub Stars 达 72, 最近一次更新时间为 2016 年 07 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 steevanb/doctrine-stats 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 steevanb/doctrine-stats 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 85.47k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 72
- 点击次数: 11
- 依赖项目数: 1
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2016-07-06

