Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ Debugger: Count how many times a function is called

I want to count how many times a function is called overall in my program. The method is called in different objects and I dont want to pass one variable through and let them all add to it.
Is there a feature in the IntelliJ Debugger that's counts how often a function is called overall?

Specificially, my program is a search-tree algorithm for a graph-problem and I want to count, how many different branches the generated search-tree has. Each of these branches corresponds to a call of the mentioned function.

like image 383
Moritz Groß Avatar asked Oct 22 '25 11:10

Moritz Groß


1 Answers

Another solution that not based on Intellij IDE, I found a tool byteman recently, it should be able to allow you to inject your code snippet into a dedicated Class method, so you can count the number of calls systematically.

like image 193
Steven Chou Avatar answered Oct 24 '25 00:10

Steven Chou



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!