Add option to record tracebacks alongside query or cache records
See original GitHub issueIn our quite large projects we sometimes have troubles understanding where a query or cache operation comes from. We sometimes record perf-rec on a whole self.client.get()
operation which may include template rendering and so on. We sometimes spend a lot of times to debug this, leading sometimes in monkeypatching django to find where the incriminating query comes from 🙄.
I thought we could have that information directly in our records, for debug purpose only of course.
So I worked on a small POC to allow the user to define a pattern in the settings, when an operation matches that pattern, it stores the current traceback alongside the other info (sql, or keys and operation…) and displays it in the yaml record.
If you find it interesting and would like for me to work on it further to integrate the feature in django-perf-rec
that’d be great 😃
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
🎉 Released in version 4.9.0, from PR #299.
Thanks for your work and persistence on this @nadege , definitely a useful addition!
Hello again 😃
Now that the refactor is done, I’m looking into this again. Could you give me more detail on the callback idea you had, if you remember ? What I understand/imagine is: a function written in the user codebase, its path passed to django-perf-rec via a settings. The setting default value would be a function returning false, so we don’t record the traceback by default. The callback would be called inside the
on_op
function, with the operation as parameter.Like this:
Or was it something else?