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

Create a callgraph of methods calling database managers #2217

Closed
lfdversluis opened this issue May 18, 2016 · 1 comment
Closed

Create a callgraph of methods calling database managers #2217

lfdversluis opened this issue May 18, 2016 · 1 comment
Assignees

Comments

@lfdversluis
Copy link

To gain insight into the amount of callers of these managers. Related to #2216.

@lfdversluis
Copy link
Author

lfdversluis commented Jun 7, 2016

Turned out not to be feasible:
callgraph

Too complex to analyze and a lot of cruff because of nose/unittests.

Approach 2

I tried converting this .callgrind trace to a dot file and for every __init__in there, perform a depth-first search to see if it lead to a database function.
Result: also not feasible because of decorators. If a function "A" calls a function decorated with "C" that eventually does DB IO, then a function "B" that does not, but also makes use of this decorator "C" on the call stack, will be marked as doing database IO too.

Approach 3

I created a simple function that loops through the callstack and checks if there is an __init__ present (but not form nose or unittests). If there is, it raises an error. Running the unit tests with this check placed on all DB IO functions result in us detecting __init__s doing IO.

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

No branches or pull requests

1 participant