Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack trace of query #800

Closed
peter-gribanov opened this issue Apr 11, 2018 · 6 comments
Closed

Stack trace of query #800

peter-gribanov opened this issue Apr 11, 2018 · 6 comments
Assignees

Comments

@peter-gribanov
Copy link

Is it possible to add a stack trace to the profiler to at least roughly understand the context of the query?

Sometimes, in the profiler there are querys that are not quite clear where they came from.
Sometimes, in the profiler there are querys that are obviously cached in repository, but they don't cached anyway.

In such cases, i want to understand where this query came from.

@kimhemsoe
Copy link
Member

dup of #722

I understand where you come from. Overall the profiling could be improved like caching. I think the way to go is to improve one feature at the time and map out what require better hooks into dbal and what does not.

@kimhemsoe kimhemsoe self-assigned this Apr 11, 2018
@peter-gribanov
Copy link
Author

peter-gribanov commented Apr 12, 2018

I would have had enough of what gives debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS):

#0  Doctrine\ORM\UnitOfWork->commit() called at [/var/www/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:358]
#1  Doctrine\ORM\EntityManager->flush() called at [/var/www/var/cache/dev/Container1qc8xmp/EntityManager_9a5be93.php:125]
#2  EntityManager_9a5be93->flush() called at [/var/www/src/Event/Subscriber/Doctrine/FlusherSubscriber.php:64]
#3  AppBundle\Event\Subscriber\Doctrine\FlusherSubscriber->flush() called at [/var/www/src/Event/Subscriber/Doctrine/FlusherSubscriber.php:46]
#4  AppBundle\Event\Subscriber\Doctrine\FlusherSubscriber->onTerminate()
#5  call_user_func() called at [/var/www/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php:104]
#6  Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke() called at [/var/www/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:212]
#7  Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() called at [/var/www/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:44]
#8  Symfony\Component\EventDispatcher\EventDispatcher->dispatch() called at [/var/www/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php:139]
#9  Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch() called at [/var/www/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:991]
#10 Symfony\Component\Console\Application->doRunCommand() called at [/var/www/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:86]
#11 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() called at [/var/www/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:248]
#12 Symfony\Component\Console\Application->doRun() called at [/var/www/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:74]
#13 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() called at [/var/www/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:148]
#14 Symfony\Component\Console\Application->run() called at [/var/www/bin/console:41]

@kimhemsoe
Copy link
Member

I suggest you start by looking at the previous issues and pull requests and continue to dbal. I believe that is where the implementation should begin. When dbal have support we can add it here.

@Ocramius
Copy link
Member

DBAL already has a DebugStack logger doing this

@kimhemsoe
Copy link
Member

well then it just need to be integrated :D go go @peter-gribanov

@peter-gribanov
Copy link
Author

@kimhemsoe 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants