I've a got a query class that is being invoked all over a large project, and one of our functions is being particularly slow. I need to identify all instances of that query being invoked by a particular function (operation) so that we can assess it. This means the function calls another function, and might have a query, and that function might call a function that makes a query, so on and so forth.
The language is proprietary language (gosu) that is an off shoot of java, so there aren't really a lot of tools built for it, but a java based solution might work.
I imagine I'm not the first person who needs this kind of solution, so I'm wondering if anyone knows how to accomplish this or knows of the canonical name for the problem?
What I've thought of so far:
I would set up loggers, but the class I want to log is an "out of the box" feature, which means we're not allowed to fiddle with it. There is a logging feature, but we're only allowed to turn on this logging feature in test/local, and not in production where the issue is happening, and we haven't been able to reproduce the issue in test or local.
Just search the directory: This works to an extent, but there's back tracking that needs to be done to clear out other functions, and it only catches what's in the directory and not what's in other packages that the function may call.
Search the package and all imported classes, and their packages/imported classes: This would definitely catch all the relevant query calls, but would likely catch more than what is needed, and possibly just catch all calls.
I know the total number of instances of the query invocations, and it's too large to go through by hand and sort which calls belong to which function.