{"id":17797374,"url":"https://github.com/steevanb/doctrine-stats","last_synced_at":"2025-03-17T16:09:43.790Z","repository":{"id":9601916,"uuid":"62727906","full_name":"steevanb/doctrine-stats","owner":"steevanb","description":"Get Doctrine stats : managed entities, lazy loaded entities, hydration time etc.","archived":false,"fork":false,"pushed_at":"2022-05-30T12:03:18.000Z","size":333,"stargazers_count":70,"open_issues_count":3,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-02T13:11:18.533Z","etag":null,"topics":["doctrine","doctrine2","php","symfony"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/steevanb.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-06T14:35:33.000Z","updated_at":"2024-10-22T07:34:27.000Z","dependencies_parsed_at":"2022-09-14T02:30:51.089Z","dependency_job_id":null,"html_url":"https://github.com/steevanb/doctrine-stats","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steevanb%2Fdoctrine-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steevanb%2Fdoctrine-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steevanb%2Fdoctrine-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steevanb%2Fdoctrine-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steevanb","download_url":"https://codeload.github.com/steevanb/doctrine-stats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244066179,"owners_count":20392406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["doctrine","doctrine2","php","symfony"],"created_at":"2024-10-27T11:55:32.837Z","updated_at":"2025-03-17T16:09:43.756Z","avatar_url":"https://github.com/steevanb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Version](https://img.shields.io/badge/version-2.0.0-4B9081.svg)](https://github.com/steevanb/doctrine-stats/tree/2.0.0)\n[![doctrine](https://img.shields.io/badge/doctrine/orm-^2.4.8-blue.svg)](http://www.doctrine-project.org)\n[![php](https://img.shields.io/badge/php-^5.4.6%20||%20^7.0||%20^8.0-blue.svg)](http://www.php.net)\n![Lines](https://img.shields.io/badge/code%20lines-2,909-blue.svg)\n![Total Downloads](https://poser.pugx.org/steevanb/doctrine-stats/downloads)\n\n### doctrine-stats\n\nAdd important Doctrine statistics:\n* Count managed entities\n* Count lazy loaded entities\n* Hydration time by hydrator and query\n* Group queries by query string, show differents parameters used by same query string\n* Count different query string used\n\n[Changelog](changelog.md)\n\n### Installation\n\n```bash\ncomposer require --dev steevanb/doctrine-stats ^2.0\n```\n\nIf you want to add hydration time to your statistics:\n\n`composer.json`\n```json\n{\n    \"autoload\": {\n        \"psr-4\": {\n            \"ComposerOverloadClass\\\\\": \"var/cache/ComposerOverloadClass\"\n        }\n    },\n    \"scripts\": {\n        \"pre-autoload-dump\": \"steevanb\\\\ComposerOverloadClass\\\\OverloadClass::overload\"\n    },\n    \"extra\": {\n        \"composer-overload-cache-dir\": \"var/cache\",\n        \"composer-overload-class-dev\": {\n            \"Doctrine\\\\ORM\\\\Internal\\\\Hydration\\\\ArrayHydrator\": {\n                \"original-file\": \"vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php\",\n                \"overload-file\": \"vendor/steevanb/doctrine-stats/src/Bridge/ComposerOverloadClass/Doctrine/ORM/Internal/ArrayHydrator.php\"\n            },\n            \"Doctrine\\\\ORM\\\\Internal\\\\Hydration\\\\ObjectHydrator\": {\n                \"original-file\": \"vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php\",\n                \"overload-file\": \"vendor/steevanb/doctrine-stats/src/Bridge/ComposerOverloadClass/Doctrine/ORM/Internal/ObjectHydrator.php\"\n            },\n            \"Doctrine\\\\ORM\\\\Internal\\\\Hydration\\\\ScalarHydrator\": {\n                \"original-file\": \"vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php\",\n                \"overload-file\": \"vendor/steevanb/doctrine-stats/src/Bridge/ComposerOverloadClass/Doctrine/ORM/Internal/ScalarHydrator.php\"\n            },\n            \"Doctrine\\\\ORM\\\\Internal\\\\Hydration\\\\SimpleObjectHydrator\": {\n                \"original-file\": \"vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php\",\n                \"overload-file\": \"vendor/steevanb/doctrine-stats/src/Bridge/ComposerOverloadClass/Doctrine/ORM/Internal/SimpleObjectHydrator.php\"\n            },\n            \"Doctrine\\\\ORM\\\\Internal\\\\Hydration\\\\SingleScalarHydrator\": {\n                \"original-file\": \"vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php\",\n                \"overload-file\": \"vendor/steevanb/doctrine-stats/src/Bridge/ComposerOverloadClass/Doctrine/ORM/Internal/SingleScalarHydrator.php\"\n            }\n        }\n    }\n}\n```\n```bash\ncomposer dumpautoload\n```\n\n### Symfony 2.x, 3.x and 4.x integration\n\nRead Installation paragraph before.\n\n```php\n# app/AppKernel.php\nclass AppKernel\n{\n    public function registerBundles()\n    {\n        if ($this-\u003egetEnvironment() === 'dev') {\n            $bundles[] = new \\Steevanb\\DoctrineStats\\Bridge\\DoctrineStatsBundle\\DoctrineStatsBundle();\n        }\n    }\n}\n```\n\nIf you want to add lazy loaded entities to your statistics:\n\n```yml\n# app/config/config_dev.yml\nparameters:\n    doctrine.orm.entity_manager.class: Steevanb\\DoctrineStats\\Doctrine\\ORM\\EntityManager\n```\n\n### Manual integration\n\nTo retrieve statistics, you need to register `Steevanb\\DoctrineStats\\EventSubscriber\\DoctrineEventSubscriber` in your event manager.\n\nIf you want to add lazy loaded entities to your statistics, you need to overload default EntityManager, with `Steevanb\\DoctrineStats\\Doctrine\\ORM\\EntityManager`.\n\n### Screenshots\n\n![Symfony profiler](symfony_profiler.jpg)\n\n![Symfony profiler panel](symfony_profiler_panel.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteevanb%2Fdoctrine-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteevanb%2Fdoctrine-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteevanb%2Fdoctrine-stats/lists"}