All Projects → steevanb → Doctrine Stats

steevanb / Doctrine Stats

Get Doctrine stats : managed entities, lazy loaded entities, hydration time etc.

Projects that are alternatives of or similar to Doctrine Stats

Core
🧿 Bolt 4 core
Stars: ✭ 243 (+273.85%)
Mutual labels:  doctrine, symfony
Forkcms
Fork is an easy to use open source CMS using Symfony Components.
Stars: ✭ 1,112 (+1610.77%)
Mutual labels:  doctrine, symfony
Doctrinecachebundle
Symfony2 Bundle for Doctrine Cache
Stars: ✭ 2,813 (+4227.69%)
Mutual labels:  doctrine, symfony
Foundry
A model factory library for creating expressive, auto-completable, on-demand dev/test fixtures with Symfony and Doctrine.
Stars: ✭ 216 (+232.31%)
Mutual labels:  doctrine, symfony
Doctrinebundle
Symfony Bundle for Doctrine ORM and DBAL
Stars: ✭ 4,225 (+6400%)
Mutual labels:  doctrine, symfony
Doctrine Bridge
Provides integration for Doctrine with various Symfony components.
Stars: ✭ 2,800 (+4207.69%)
Mutual labels:  doctrine, symfony
Fossdroid Core
Fossdroid Core is a web frontend of F-Droid: an alternative software repository comprising only free, open source software for Android. This repo is the open source version of fossdroid.com.
Stars: ✭ 329 (+406.15%)
Mutual labels:  doctrine, symfony
Msgphp
Reusable domain layers. Shipped with industry standard infrastructure.
Stars: ✭ 182 (+180%)
Mutual labels:  doctrine, symfony
Sonatadoctrineormadminbundle
Integrate Doctrine ORM into the SonataAdminBundle
Stars: ✭ 400 (+515.38%)
Mutual labels:  doctrine, symfony
Schema Generator
PHP Model Scaffolding from Schema.org and other RDF vocabularies
Stars: ✭ 379 (+483.08%)
Mutual labels:  doctrine, symfony
Idea Php Annotation Plugin
Add PHP annotation support for PhpStorm and IntelliJ
Stars: ✭ 216 (+232.31%)
Mutual labels:  doctrine, symfony
Doctrine Json Odm
An object document mapper for Doctrine ORM using JSON types of modern RDBMS.
Stars: ✭ 420 (+546.15%)
Mutual labels:  doctrine, symfony
Core
Zikula Core Framework
Stars: ✭ 213 (+227.69%)
Mutual labels:  doctrine, symfony
Sonata Doctrine Extensions
Doctrine2 behavioral extensions
Stars: ✭ 239 (+267.69%)
Mutual labels:  doctrine, symfony
Grav
Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony
Stars: ✭ 13,067 (+20003.08%)
Mutual labels:  doctrine, symfony
Translationformbundle
Ease translations with some dedicated Symfony form types
Stars: ✭ 289 (+344.62%)
Mutual labels:  doctrine, symfony
Orm Pack
A Symfony Pack for Doctrine ORM
Stars: ✭ 1,850 (+2746.15%)
Mutual labels:  doctrine, symfony
Doctrinefixturesbundle
Symfony integration for the doctrine/data-fixtures library
Stars: ✭ 2,174 (+3244.62%)
Mutual labels:  doctrine, symfony
Doctrinemigrationsbundle
Symfony integration for the doctrine/migrations library
Stars: ✭ 3,782 (+5718.46%)
Mutual labels:  doctrine, symfony
Doctrineenumbundle
📦 Provides support of ENUM type for Doctrine in Symfony applications.
Stars: ✭ 410 (+530.77%)
Mutual labels:  doctrine, symfony

version doctrine php Lines Total Downloads Scrutinizer

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

Installation

composer require --dev "steevanb/doctrine-stats": "^1.4"

If you want to add hydration time to your statistics :

# composer.json
{
    "require-dev": {
        "steevanb/composer-overload-class": "^1.1"
    },
    "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/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/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/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/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/ComposerOverloadClass/Doctrine/ORM/Internal/SingleScalarHydrator.php"
            }
        }
    }
}
composer update steevanb/composer-overload-class

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

Symfony profiler

Symfony profiler panel

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].