What is the most efficient way to collect and report performance statistic analysis from an application?
If I have an application that uses a series of network apis, and I want to report statistics at runtime, e.g.
Method doA() was called 3 times and consumed on avg 500ms
Method doB() was called 5 times and consumed on avg 1200ms etc
Then, I thought of using a well defined data structure (of collection) that each thread updates per remote call, and this can be used for the report.
But I think that it will make the performance worse, for the time spend for statistics collection. Am I correct? How would I procceed if I used a background thread for this, and the other threads that did the remote calls were unaware of this collection gathering?
Thanks