PHPackages                             steevanb/doctrine-stats - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. steevanb/doctrine-stats

ActiveLibrary[Database &amp; ORM](/categories/database)

steevanb/doctrine-stats
=======================

Count managed and lazy loaded entities, hydration time etc

2.0.0(4y ago)7285.5k↑252.1%9[3 issues](https://github.com/steevanb/doctrine-stats/issues)1MITPHPPHP ^7.1 || ^8.0

Since Jul 21Pushed 4y ago4 watchersCompare

[ Source](https://github.com/steevanb/doctrine-stats)[ Packagist](https://packagist.org/packages/steevanb/doctrine-stats)[ RSS](/packages/steevanb-doctrine-stats/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (4)Dependencies (9)Versions (14)Used By (1)

[![Version](https://camo.githubusercontent.com/fe9bea5cc86b051ffd38a9179803c034f855ae45fe82331bb1f5c12d8626e0d0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d322e302e302d3442393038312e737667)](https://github.com/steevanb/doctrine-stats/tree/2.0.0)[![doctrine](https://camo.githubusercontent.com/d743e28e1f4dc34d9f708257ec970c9a624213e5887a8ef974d5c7f2967748cb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f637472696e652f6f726d2d253545322e342e382d626c75652e737667)](http://www.doctrine-project.org)[![php](https://camo.githubusercontent.com/f288b34d8fb8d3851e65411daf02e6bf23ef83d57bbd19a52d35f15a3dda9b6e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545352e342e36253230253743253743253230253545372e30253743253743253230253545382e302d626c75652e737667)](http://www.php.net)[![Lines](https://camo.githubusercontent.com/dc8b65e7714c8b4d60ec8112114b774734f2a791e2269f8239c7af65b6ea7272/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532306c696e65732d322c3930392d626c75652e737667)](https://camo.githubusercontent.com/dc8b65e7714c8b4d60ec8112114b774734f2a791e2269f8239c7af65b6ea7272/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532306c696e65732d322c3930392d626c75652e737667)[![Total Downloads](https://camo.githubusercontent.com/db7571fb61ac8df40f6427a056b93405658058aa9e04a7999e01ffe57477ec41/68747470733a2f2f706f7365722e707567782e6f72672f7374656576616e622f646f637472696e652d73746174732f646f776e6c6f616473)](https://camo.githubusercontent.com/db7571fb61ac8df40f6427a056b93405658058aa9e04a7999e01ffe57477ec41/68747470733a2f2f706f7365722e707567782e6f72672f7374656576616e622f646f637472696e652d73746174732f646f776e6c6f616473)

### doctrine-stats

[](#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

[Changelog](changelog.md)

### Installation

[](#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

[](#symfony-2x-3x-and-4x-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

[](#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

[](#screenshots)

[![Symfony profiler](symfony_profiler.jpg)](symfony_profiler.jpg)

[![Symfony profiler panel](symfony_profiler_panel.jpg)](symfony_profiler_panel.jpg)

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 91.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~163 days

Recently: every ~393 days

Total

13

Last Release

1679d ago

Major Versions

1.4.0 → 2.0.02021-11-29

PHP version history (3 changes)1.0.0PHP &gt;=5.4.0

1.1.0PHP ^5.4.0 || ^7.0

2.0.0PHP ^7.1 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e59638521a0ca6412cd2fa506834e384d4bac92197159891d4ccfe8e4b3d61eb?d=identicon)[steevanb](/maintainers/steevanb)

---

Top Contributors

[![steevanb](https://avatars.githubusercontent.com/u/5063383?v=4)](https://github.com/steevanb "steevanb (57 commits)")[![gsdevme](https://avatars.githubusercontent.com/u/319498?v=4)](https://github.com/gsdevme "gsdevme (3 commits)")[![Gemorroj](https://avatars.githubusercontent.com/u/885731?v=4)](https://github.com/Gemorroj "Gemorroj (2 commits)")

---

Tags

doctrinedoctrine2phpsymfony

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/steevanb-doctrine-stats/health.svg)

```
[![Health](https://phpackages.com/badges/steevanb-doctrine-stats/health.svg)](https://phpackages.com/packages/steevanb-doctrine-stats)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
