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

support displaying the actual queries that failed the limit #16

Open
zsoldosp opened this issue Nov 24, 2016 · 0 comments
Open

support displaying the actual queries that failed the limit #16

zsoldosp opened this issue Nov 24, 2016 · 0 comments

Comments

@zsoldosp
Copy link
Owner

current workaround to achieve this is

            from django_performance_testing.signals import results_collected
            def dump_queries(sender, results, context, **kwargs):
                try:
                    write_result, = (r for r in results if r.name =='write')
                    if write_result.queries:
                        print '\n'.join(q['sql'] for q in  write_result.queries)
                except ValueError:
                    pass
            results_collected.connect(dump_queries)
            with QueryBatchLimit(write=0):
                ....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant